0 Replies Latest reply on Mar 30, 2002 9:54 AM by Ralf Ebert

    Strange rollbacks with MySQL and jBoss Beta 2

    Ralf Ebert Newbie

      Hi,

      I'm using jBoss 3 beta 2 and MySQL 3.23 at the moment. All my tables are InnoDB, so transactions are supported. I have some session and some entity beans, entity beans are CMP 2.0. In the session bean I implemented parts of the business logic which use the entity beans to manipulate data. These manipulations are to be done in one database transaction, so I set the transactions to container-managed and set the methods to require a transaction (Required).
      If I try to call such a method now I get transaction errors. jBoss claims that he expected one affected row but got none. I looked at the MySQL logs to determine what happend. jBoss sends the query and directly after it does a rollback. In the next query (which depends on the first), he tries to manipulate the already manipulated database row. This fails because the first query was rolled back (the 2nd query can't work without the first one). The behaviour I expected was starting a transaction, doing all queries and commiting it.
      What can be the reason of this problem ? I use jBoss 3.0 beta 2 (build from yesterday). As workaround (not as solution) I set the AutoCommit property of my database connection to true. So I get error messages (because he can't rollback in autocommit mode). But I get all neccessary changes in the database done.

      Thanks for any help,
      Regards,
      Ralf Ebert