Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] transaction handling question

New to JPA and having trouble getting it working correctly.  

I am running on WAS 6.1 with a DB2 datasource defined.  In my
persistence.xml I have a <jta-data-source> pointing to that jndi datasource.
	<persistence-unit name="cpsjpa" transaction-type="JTA">
		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
		<jta-data-source>jdbc/DB2DS</jta-data-source>

In my persistence.xml I had some conflicting entries referring to openjpa
properties.  I have just removed them and now I just have these -
            <property name="eclipselink.target-server"
value="WebSphere_6_1"/>
            <property name="eclipselink.target-database" value="DB2"/>

The thing that is confusing is that before I took these out I was able to do
this in my code -
                entityManager.getTransaction().begin();
                entityObject =
this.cpTransactionManager.update(entityObject);
                entityManager.getTransaction().commit();

Now since taking those openjpa entries, I get transaciton errors -
Exception Description: Cannot use an EntityTransaction while using JTA.
	at
org.eclipse.persistence.internal.jpa.transaction.JTATransactionWrapper.getTransaction(JTATransactionWrapper.java:65)
	at
org.eclipse.persistence.internal.jpa.EntityManagerImpl.getTransaction(EntityManagerImpl.java:863)

Is there something I am missing here?
-- 
View this message in context: http://www.nabble.com/transaction-handling-question-tp22605871p22605871.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top