ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bing Qiao <qiaob...@gmail.com>
Subject IMPLICIT_TRANSACTIONS and sqlmap Transaction
Date Mon, 15 Aug 2005 10:30:10 GMT
Hello,

I'm using sqlmap transaction in java to call a stored procedure:
/******************************************/
try {
      Treasury.startTransaction();
      rtn = ServiceFacade.updateActionStatus(this.getPayment().
          getPaymentid());
      if (rtn) {
        Treasury.commitTransaction();
      }

    }
    finally {
      Treasury.endTransaction();
    }

public static boolean updateActionStatus(int paymentid) {
    try {
      sqlmap.update("updateActionStatus", new Integer(paymentid));
    }
    catch (Exception e) {
      return false;
    }
    return true;
  }
/***************************************************/
updateActionStatus is mapped to a stored procedure.

It seems that to make the transaction work, I can't use SET
IMPLICIT_TRANSACTIONS OFF in this stored procedure without putting
something like a query before it.

In other words, if I call two stored procedures in the transaction
block. If the first one is a query and the second one an update with
SET IMPLICIT_TRANSACTIONS OFF in it. The transaction works.

However, if the update is called first, the transaction does not work.

BTW, the update stored procedure has its own transactions too.

I could drop the  SET IMPLICIT_TRANSACTIONS OFF to make it work. But
there are dozens of others. Could somebody advice a right way to use
both sqlmap transaction in java and MS SQL Server's transactions in
stored procedures. And how to handle the SET IMPLICIT_TRANSACTIONS
OFF.

Thanks very much!

Bqiao

Mime
View raw message