Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cannot commit in Global transaction  RSS feed

 
koshka Sagar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thru a EJB i make calls to Data access objects. The method of the DAO have many queries fired on different tables.
say inserts on 4 tables.
//fire first insert query
if(firstQueryInsert is != 0)
{
//then fire second insert query
if(secondQueryInsert is != 0)
{
//then fire third insert query
if(thirdQueryInsert is != 0)
{
commit();
}
}
1. I am using StatelessSessionBean. Transaction type is container
2. using websphere4.0
3. using datasource to get connection.
4. each method of the DataAccessObject(DAO) gets a connection
and invokes setAutoCommit(false); and finally in the end
calls commit().
Fature :
This code works fine on weblogic6.0 and not on websphere 4.0
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the setAutoCommit() methods and the commit(). You are NOT supposed to do this with any EJB container -- that's the point of container-managed transactions!
It should work in both containers after you do this.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if it is a BMT?
what will happen for connection.commit
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!