wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes PersistenceException: Cannot set auto-commit mode when using distributed transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "PersistenceException: Cannot set auto-commit mode when using distributed transactions" Watch "PersistenceException: Cannot set auto-commit mode when using distributed transactions" New topic
Author

PersistenceException: Cannot set auto-commit mode when using distributed transactions

Siphiwe Madi
Ranch Hand

Joined: Aug 16, 2007
Posts: 70
Hi All,

I'm trying to run a simple example from Chapter 2 where the PlaceBidBean tries to persist a Bid object to the DB Table (BIDS),
however upon running the PlaceBidBeanClient to test the Session bean through ANT i get the following error:

run:
[echo] Executing client class
[java] javax.ejb.EJBException: nested exception is: <1.0.0.1.1 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Cannot set auto-commit mode when using distributed transactions
[java] <1.0.0.1.1 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Cannot set auto-commit mode when using distributed transactions
[java] at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:546)

[java] at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:1040)
[java] at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
[java] at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
[java] Caused by: java.lang.Exception: java.sql.SQLException: Cannot set auto-commit mode when using distributed transactions



And I cannot find a way that i can manually configure the JDBC Connection Pool to disable autocommit.

Can anyone please advice - i have searched the Net but there is no solution that i have successfully found.





Regards, Siphiwe Madi
[SCJP, SCWCD, __] Next ... scjwsd
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 639
check your datasource properties in your xml file or thru application server console.

All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Siphiwe Madi
Ranch Hand

Joined: Aug 16, 2007
Posts: 70
Hi,
I have checked my datasource, everything looks fine. Is there a place withing DB or App Server where I can turn auto-commit off?

Please assist - I have been stuck on trying to run chapter 2 using Oracle db ever since and time is running out on me

Help
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 639
I have checked my datasource, everything looks fine. Is there a place withing DB or App Server where I can turn auto-commit off?


what looks fine? where did you check your datasource in datasource xml file or persistence.xml ?

yes you can change setting in App Server, for websphere there is no default property ,so you will have to add customer property and set the value not sure about weblogic.

-Praful
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PersistenceException: Cannot set auto-commit mode when using distributed transactions