openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lance J. Andersen" <Lance.Ander...@Sun.COM>
Subject Re: Same database, two EMF, different derby drivers
Date Thu, 18 Oct 2007 13:58:45 GMT
I would not do this unless the process which is starting the embedded 
version of Derby is also allowing network connections via the embedded 
server.  Otherwise, you are going to risk corruption of the database.  
See 
http://db.apache.org/derby/papers/DerbyTut/ns_intro.html#Embedded+Server  
for details. 

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.
>
>   

Mime
View raw message