Objectdb Server Mode set up with glassfish

#1

Hi

I'm new to Java, glassfish and objectdb, so please forgive my ignorance.

I have a glassfish server working with the embeded mode of objectdb. I now want to set up objectdb in server mode. I have run the server.exe but I don't know what to do next ?!  Which jar far do I need to include in my project ? How do I configure my persitence.xml file ? Do I need to set up something in Glassfish ?

 

Thanks

Paul Newman

#2

You should use exactly the same ObjectDB JAR.

The only difference is the database connection url.

If specified in the persistence.xml a client-server url could be specified as follows:

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">

   <persistence-unit name="my-pu">
     <description>My Persistence Unit</description>
     <provider>com.objectdb.jpa.Provider</provider>
     <properties>
       <property name="javax.persistence.jdbc.url"
                 value="objectdb://localhost/my.odb"/>
       <property name="javax.persistence.jdbc.user" value="admin"/>
       <property name="javax.persistence.jdbc.password" value="admin"/>
     </properties>
   </persistence-unit>

</persistence>

 

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login