• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

BMP stateless session bean can't roll back using JTA

Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use weblogic6.1sp2 + jdk131
A stateless session bean must do 2 things:
insert a record to A table and delete another record in A table
This bean has the same structure as the example in j2eetutorial/examples/src/ejb/teller
I use TxDataSource in weblogic
If delete fail, the roll back is run,but in database,
the insert record is STILL in A table.
I close the connection autocommit,but find no records can be inserted into the table,why?
Code For begin,commit and rollback
UserTransaction ut = null;
ut = sessionContext.getUserTransaction();
//test code
}catch(Exception e){
try {
catch (SystemException se) {
Code for connection:
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(dbName);
con = ds.getConnection();
    Bookmark Topic Watch Topic
  • New Topic