• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

cannot commit in Global transaction  RSS feed

 
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
 
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.
 
Ranch Hand
Posts: 8934
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!