• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Siphiwe Madi
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.




 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check your datasource properties in your xml file or thru application server console.
 
Siphiwe Madi
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic