• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Transaction not rolling back if I call ejbSelectXXX()

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic