After doing some more explorations; I think the solution to my issues is one of the following:
Create new domain for each version of the web service. The virtual server does not work as resources are not separated by virtual server.
OR
When compiling the Web Service do the following:
1. compile the persistence.xml with a datasource that specifies the version of the Web Service. In my case; I will have to change the jta-data-source element to include this version number.
2. Name the web service so that it includes the version number by using the @WebService annotation with serviceName parameter having the version number. Thus my web services would be accessible at:
http://.../WebServiceV1/Service,
http://.../WebServiceV2/Service, etc.
Thanks
- Ravi
-----Original Message-----
From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
Sent: Friday, August 01, 2008 19:42
To: persistence_at_glassfish.dev.java.net
Subject: Re: Question about "switching" JTA datasources in glassfish when using Toplink
Right. You can define in addition Datasource_pool2 and change Datasource1
to use Datasource_pool2, and then again Datasource_pool without changing
anything in the persistence.xml.
Regards,
-marina
Kulkarni, Ravi wrote:
> In my persistence.xml I'm already specifying the JDBC pool name and not
> the connection pool name. Sorry, if it was confusing in my original
> e-mail.
>
> Here is how we are setting it up:
>
> JDBC Resources:
> JNDI name: Datasource1
> Pool Name: Datasource_pool
>
> Connection Pools:
> Name: Datasource_pool
> ResourceType: javax.sql.DataSource
> DataSource classname:
> com.mysql.jdbc.jdbc2.optional.MysqlDataSource
>
>
> Thanks for responding promptly.
> - Ravi
>
> -----Original Message-----
> From: Marina.Vatkina_at_Sun.COM [mailto:Marina.Vatkina_at_Sun.COM]
> Sent: Friday, August 01, 2008 18:01
> To: persistence_at_glassfish.dev.java.net
> Subject: Re: Question about "switching" JTA datasources in glassfish
> when using Toplink
>
> Hello Ravi,
>
> You can set up 2 jdbc pools in GlassFish, and toggle jdbc-resource
> reference to
> point to one pool or the other. You might need to restart the glassfish
> server
> for TopLink to reread the settings and acquire new connections.
>
> Regards,
> -marina
>
> Kulkarni, Ravi wrote:
>
>>Hello,
>>
>>
>>
>>I've a web service deployed in Glassfish. The Web Service uses Toplink
>
>
>>for the JPA. One of the requirements from the QA (and engineering
>
> team)
>
>>is that whenever an issue is fixed; they want to first duplicate it in
>
>
>>the original version of the Web Service and then verify it to be fixed
>
>
>>in the latest version of the Web Service. The Web Service uses Toplink
>
>
>>EntityManager and specifies the datasource in the persistence.xml. We
>>are trying to see if we can deploy two versions of the Web Service on
>>the same server (either under different path, ports or virtual
>
> server).
>
>>However; as the persistence.xml is compiled-in into the .ear; we have
>
> no
>
>>easy way of changing the datasource used by the Web Service. I.e.;
>>without re-compiling the source; we want to say that yesterday the Web
>
>
>>Service was using Datasource1; today the same Web Service should use
>>Datasource2. We are okay if we have to restart glassfish to achieve
>
> this
>
>>change.
>>
>>
>>
>>We understand that we would also require quite a few databases for
>
> this
>
>>type of support. In my simple example; two; but someone from QA when
>>verifying problems reported in multiple versions; may require those
>
> many
>
>>databases.
>>
>>
>>
>>What are my options?
>>
>>
>>
>>Thanks
>>
>>- Ravi
>>
>>
>>
>
>
>