0 Replies Latest reply on Apr 25, 2006 3:03 AM by sajid2045

    Transaction not rolling back if I call ejbSelectXXX()

    sajid2045

      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.