File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes NO commit() in code, but getting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "NO commit() in code, but getting "Operation Connection.commit is not allowed during a global transa"" Watch "NO commit() in code, but getting "Operation Connection.commit is not allowed during a global transa"" New topic
Author

NO commit() in code, but getting "Operation Connection.commit is not allowed during a global transa"

K Mansoor
Ranch Hand

Joined: Jan 10, 2006
Posts: 52
Hi All-

I'm not calling commit() anywhere in my code, but am getting this error:


I'm able to read an object from DB, but not persist. Any help would be greatly appreciated.
Code Incomplete
Greenhorn

Joined: Mar 15, 2011
Posts: 3
Did you find a resolution to this yet?
I'm fighting the same issue, slightly different env (WAS 7.0.0.13 + jpa 2.0 FeP, sqlserver 2005)
Code Incomplete
Greenhorn

Joined: Mar 15, 2011
Posts: 3
I found a solution posted in another forum:
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=260658

In my case, the solution amounted to setting a custom property on the XA datasource
property: nonTransactionalDataSource
value: true

this seems counter-intuitive, since I'm specifically trying to perform transactions with this datasource...

I have my project configured to the point where I can comment/uncomment sections in 2 files to swap back and forth
between Hibernate and OpenJPA as the persistence provider. This setting was not required for Hibernate, but it does not
seem to negatively affect the Hibernate configuration.
Code Incomplete
Greenhorn

Joined: Mar 15, 2011
Posts: 3
Please note that the environment for the previous posted solution
was different from the originally posed problem.
My environment is:
WAS 7.0.0.13 + JPA 2.0 FeaturePak
Spring 3.x
OpenJPA 2.0 (snapshot version which comes with the feature pak)

Also swapped the same application to use Hibernate 3.5-FINAL
Using container-managed transactions

Hopefully the same will work for the WAS 6, JPA 1.0 environment
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NO commit() in code, but getting "Operation Connection.commit is not allowed during a global transa"