0 Replies Latest reply on Feb 8, 2005 2:50 PM by yetang

    how to config to make the transaction work?

    yetang

      hi, i am using jboss 3.2.5, mysql 4.0, Eclipse 2.1, lomboz 2.1, xdoclet

      i dont know why the operation(insertUser) does not roll back even i call setRollbackOnly().

      /**
      * @ejb.interface-method
      * @ejb.transaction type="Required"
      */
      public void processPass (Hashtable order) throws Exception {
      insertUser(); //db connection is fine. succeed all the time
      try {
      processOrder(order); //i made this throw a fileNotFound exception
      } catch (Exception e) {
      e.printStackTrace();
      sessionContext.setRollbackOnly();
      //coz processOrder() fails, i expect insertUser()
      //rolls back...but it never happened }
      }

      i can not figure out what is wrong. here are my config files:
      {jboss_home}/server/default/config/jboss-service.xml never been changed
      {jboss_home}/server/default/deploy/transaction-service.xml never been changed
      {jboss_home}/server/default/deploy/mysql-ds.xml is like this:

      <local-tx-datasource>
      <jndi-name>DefaultDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/mytest</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>root</user-name>
      <pass---word>1234</pass---word>
      </local-tx-datasource>

      the code should have no problem, i guess i might missed something in one config file...any help plz.