• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction not rolling back if I call ejbSelectXXX()

 
Sajid Moinuddin
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I am just lost here.
In my business method, I have,

this.setX(10); //x was 0
ejbSelectSomeMethod(20);
this.setY(20); // y was 0
try
{
callToAnotherMethod(); //I get an exception here.
}
catch(Exception e)
{
getEntityContext().setRollBackOnly();
throw e;
}

Now, what happnes is quite funny. now the database row that represents the bean has , x = 10 AND y=0. What can I call it? partial rollback ??!!

According to the spec, If I call an ejbSelect<> container will call an ejbStore() on the bean to reflect changes made before ejbSelect.But The ejbSelect is supposed to run in the same transaction context as the calling method. So if that method rolls back, How come x does not change to it's initial value?? Where goes the Atomicity of "ACID"??

All my methods are marked with transaction "Required" attribute.

I am using jboss4. I am using the default jboss configuration except datasource is mysql. Didn't specified any caching policy/isolation lavel.

Is this a bug in jboss or it's some basic conception problem with me? Am I getting it all wrong??

regards,
Sajid.
 
Sajid Moinuddin
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
found the problem. I have to change the type of my tables to innodb. other types doesn't support transactions.
regards,
Sajid
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic