0 Replies Latest reply on Jun 20, 2002 2:44 PM by mack81

    mm.gjt.mysql&transaction

    mack81

      hi there all.
      i'm trying to develop a 3-tier application using JBoss 2.4.4 with embedded Catalina and MySql 3.23.47.

      I'm using the mm.gjt driver (which i've seen everybody uses). I created a DataSource in jboss.jcml, everything works just fine with updates, deletes, inserts and so on.(myql tables are BdB - which they say have support for transactions)
      I also use 2 stateless session beans. Here comes the problem: i'm trying to delete some rows from 2 tables, but i want the suite of operations to be performed as a transaction. so i deploy the bean with the Required transactional atribute and with container managed transaction.From the client (say a jsp), i simply call the method of the bean which does the following things:
      1. get a connection form the datasource
      2. deletes some rows from table A
      3. deletes some rows from table B
      4. returns the status of the operation.

      Let's say that the second delete fails (for example, i send a malformed sql expresion). So, i would expect that the first delete should fail too, and the state of the database should be as it was before calling the bean method. This does not happen. The rows from table A are deleted, and the bean returns the failure status code.

      What the hack am I doing wrong? Doesn't Jboss wrap all the operations inside the bean method in a transaction, and then rolls it back if an atomic operation fails?

      Is there anything i'm missing?How else can I do it?
      I'm looking forward to receive any comments on this. If you've had experiences with jboss and mysql concerning transactions, please post a message or send a email to mariusc@algoritma.ro