3 Replies Latest reply on Feb 5, 2003 7:37 AM by sebastien_petrucci

    Bug in JBoss3.2.0RC1

    sebastien_petrucci

      Hi,

      I *think* I found a bug in the CMP engine.

      It looks like when an SQLException is thrown within a ejbPostCreate() method, no CreateException is thrown back.
      The create returns then normally but when an exception is raised during the commit.

      Anybody else has this problem ?

      Jboss : JBoss 3.2.0 RC1
      OS : Windows 2k
      DB : MySQL 4.x gamma (InnoDB)+ MySQL Connector/J 4.0.3 gamma

      Regards,
      Sebastien.

        • 1. Re: Bug in JBoss3.2.0RC1
          gchini

          Hi, I have the same problem with Oracle 8.1.7
          I have a session facade and Jboss throws A TransactionRolledBackException and not the CreateException and my session bean dies...

          • 2. Re: Bug in JBoss3.2.0RC1
            sebastien_petrucci

            And by the way... I'am just realizing something important : an EJB create is not always 'atomic' !

            Imagine you have a method like :

            Bean1Home.create(String id, String data, Bean2 bean2)

            Bean2 has a relation to Bean1. You set it in the create method to enforce the API user to set the relation.
            Due to EJB limitations, the relation cannot be built in ejbCreate but has to be set in ejbPostCreate.

            Now, what happens if ejbCreate() works but ejbPostCreate fails ?? the create method is supposed to throw a CreateException (which seems not to be the case on JBoss 3.2 RC1) but what happens to the partial DB record ? I suppose that a rollback needs to be triggered to ensure DB integrity...

            • 3. Re: Bug in JBoss3.2.0RC1
              sebastien_petrucci

              About the bug ... I also noticed that it only happens
              when you set CMR in the ejbPostCreate() ... it works normally with a CMP field.