I have not been able to make OpenJPA 1.2 work in Glassfish 2.1.1 without
having a jta-data-source referenced in persistencexml. So this
persistence.xml does not work because of no jta-datasource (default
datasource in Glassfish is used instead of my setup):
<persistence version="1.0" >
<persistence-unit name="entityManager" transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>domain.Player</class>
<class>domain.Account</class>
<properties>
<property name="openjpa.ConnectionURL"
value="jdbc:jtds:sqlserver://localhost:1433/DB1" />
<property name="openjpa.ConnectionDriverName"
value="net.sourceforge.jtds.jdbc.Driver" />
<property name="openjpa.ConnectionUserName" value="DB1"
/>
<property name="openjpa.ConnectionPassword" value="DB1"
/>
</properties>
</persistence-unit>
</persistence>
This works better:
<persistence version="1.0" >
<persistence-unit name="entityManager" transaction-type="JTA">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<jta-data-source>DB1_Datasource</jta-data-source>
<class>domain.Player</class>
<class>domain.Account</class>
<properties>
</properties>
</persistence-unit>
</persistence>
So I am trying to use container managed transactions from EJB3 stateless
beans using OpenJPA as persistence provider. The reason why I try to use the
openjpa.ConnectionURL configuration is because I want to use Slice in
OpenJPA.
--
View this message in context:
http://n2.nabble.com/OpenJPA-without-jta-data-source-in-persistence-xml-tp4930234p4930234.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.