openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Prud'hommeaux <mprud...@apache.org>
Subject Re: Same database, two EMF, different derby drivers
Date Thu, 18 Oct 2007 03:41:29 GMT
Gavin-

There shouldn't be any problem. Note that you can also use a single  
EMF, and just multiple EMs from the single EMF.

As an aside, you might want to consider using connection pooling. See:

   http://openjpa.apache.org/faq.html


On Oct 17, 2007, at 8:37 PM, Gavin Bong wrote:

> Hi,
>
> If I point two EMFs at the same database (meaning same 'name') but  
> with
> different Derby drivers, will there be any problems ?
> In short, will this work ?
>
> e.g.
>
> <persistence-unit name="derby-embedded" transaction- 
> type="RESOURCE_LOCAL">
> <properties>
>       <property name="openjpa.ConnectionURL"
>                 value="jdbc:derby:mydb;create=true"/>
>       <property name="openjpa.ConnectionDriverName"
>                 value="org.apache.derby.jdbc.EmbeddedDriver"/>
> ....snip...
> </persistence-unit>
>
>
> <persistence-unit name="derby-network" transaction- 
> type="RESOURCE_LOCAL">
> <properties>
>       <property name="openjpa.ConnectionURL"
>                 value="jdbc:derby://localhost:1527/mydb;create=true"/>
>       <property name="openjpa.ConnectionDriverName"
>                 value="org.apache.derby.jdbc.ClientDriver"/>
> ....snip...
> </persistence-unit>
>
> Thanks.
>
> -- 
> Regards,
>
> Gavin Bong
> blogging at http://raverun.com/jayway
>
> -----
> Ce qui compte dans une vie,
> c'est l'intensité d'une vie,
> ce n'est pas la durée d'une vie
> ~ Jacque Brel
>
> Be liberal in what you accept,
> and conservative in what you send
> ~ Jon Postel, RFC1122


Mime
View raw message