Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

BMP stateless session bean can't roll back using JTA  RSS feed

yunfat chou
Posts: 3
  • Mark post as helpful
  • send pies
  • 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();
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!