Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 42096 invoked from network); 15 Aug 2005 10:30:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Aug 2005 10:30:18 -0000 Received: (qmail 50430 invoked by uid 500); 15 Aug 2005 10:30:15 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 50271 invoked by uid 500); 15 Aug 2005 10:30:14 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 50215 invoked by uid 99); 15 Aug 2005 10:30:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 03:30:13 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of qiaobing@gmail.com designates 64.233.182.201 as permitted sender) Received: from [64.233.182.201] (HELO nproxy.gmail.com) (64.233.182.201) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2005 03:30:33 -0700 Received: by nproxy.gmail.com with SMTP id l37so211259nfc for ; Mon, 15 Aug 2005 03:30:10 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=H+6VwkJawKgEwC7BvLM/A2ddiVtcXokUE+e/zRaggD7RwKcPE5rtxmFO64glb/rMDpUzJkhrHjj33pCo8eU658r1Ta+UMc2/mikPP9BrbmySAX7lg9leBag9tfDodbtzotc6Ks3GB7A/zxbf2K6lFvmPLmUEgbt4x4Lr4Mp7CG4= Received: by 10.48.239.18 with SMTP id m18mr150907nfh; Mon, 15 Aug 2005 03:30:10 -0700 (PDT) Received: by 10.49.1.4 with HTTP; Mon, 15 Aug 2005 03:30:10 -0700 (PDT) Message-ID: <82ad83f705081503304305d45a@mail.gmail.com> Date: Mon, 15 Aug 2005 11:30:10 +0100 From: Bing Qiao To: user-java@ibatis.apache.org Subject: IMPLICIT_TRANSACTIONS and sqlmap Transaction Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello, I'm using sqlmap transaction in java to call a stored procedure: /******************************************/ try { Treasury.startTransaction(); rtn =3D 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