Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 32510 invoked from network); 3 Oct 2008 21:04:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Oct 2008 21:04:30 -0000 Received: (qmail 48604 invoked by uid 500); 3 Oct 2008 21:04:26 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 48591 invoked by uid 500); 3 Oct 2008 21:04:26 -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 48580 invoked by uid 99); 3 Oct 2008 21:04:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Oct 2008 14:04:26 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of demablogia@gmail.com designates 209.85.162.183 as permitted sender) Received: from [209.85.162.183] (HELO el-out-1112.google.com) (209.85.162.183) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Oct 2008 21:03:24 +0000 Received: by el-out-1112.google.com with SMTP id s27so434869ele.24 for ; Fri, 03 Oct 2008 14:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=W/bbnIqqopoRKMFaT/PRl5bnFHYIA/ZS1ozsADr1zgc=; b=xy5gIdtsZ4E/K31twQt5g3aKqau8QnJggCg+IiJbyRZJpv4JjDkC7FNt7Dja89osSa MLzG2i7MDQk2EQb1CFlXvK7AHdkw4qld9GvhSZDhgjwLDZfEa71Zs0lMBmUYngyZogOv 0jKC8LsfUkme7pBycCNrvbCBiu7/TwdBFwcBA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=gO9TpKLwNG88doHc82n0DEPhK5IXK8Yh/9xgd6S0GdQD7z/ltT7ppR4MeSGPqmpCfv J67wSu++iyV5zEmztBS5w8TG52L7UVDjtwikp0Drza3BZ1R3YXVpwhZA/2DwUgo+Xe9r wjeyIbZjgHzKkHZuHGaQdWOOExQRQjLIlb/rk= Received: by 10.150.202.9 with SMTP id z9mr2596921ybf.22.1223067829540; Fri, 03 Oct 2008 14:03:49 -0700 (PDT) Received: by 10.150.186.8 with HTTP; Fri, 3 Oct 2008 14:03:49 -0700 (PDT) Message-ID: <55efbd800810031403j728ac48bh1fff0920a25de942@mail.gmail.com> Date: Fri, 3 Oct 2008 23:03:49 +0200 From: Chema To: user-java@ibatis.apache.org Subject: Re: java.sql.SQLException: You cannot commit during a managed transaction In-Reply-To: <48E672FB.6010306@kinokai.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <55efbd800810030353m260a675fq4079f3d9a88ae655@mail.gmail.com> <48E6124E.7040008@kinokai.de> <55efbd800810030601l3c1e3216g7734d7918c4b6eb0@mail.gmail.com> <48E62AC5.3060305@kinokai.de> <55efbd800810031144u7667b990p32f4f19a964d20b9@mail.gmail.com> <55efbd800810031205o57fff002r1bd39510521000d6@mail.gmail.com> <48E672FB.6010306@kinokai.de> X-Virus-Checked: Checked by ClamAV on apache.org I guess it's not possible. I 'm going to use JDBC API, I guess Thank you very much !! 2008/10/3 Kai Grabfelder : > Jeff is totaly right, with this configuration iBATIS will never take part in the container managed transactions... > > > --- Original Nachricht --- > Absender: Jeff Butler > Datum: 03.10.2008 21:14 >> I think you should use EXTERNAL transaction manager - this is EXACTLY >> why it exists. JBOSS, not iBATIS, is your transaction manager in this >> case. >> >> Jeff Butler >> >> On Fri, Oct 3, 2008 at 2:05 PM, Chema wrote: >>> I don't want to keep the secret :-D >>> >>> >>> >> cacheModelsEnabled="true" >>> enhancementEnabled="true" >>> maxSessions="128" >>> maxTransactions="64" >>> maxRequests="512"/> >>> >>> >>> >>> >>> >>> >>> >>> >>> No more. >>> And like you said, I don't use an EXTERNAL tx manager, but JDBC type >>> >>> I think that the only solution is perform "delete" sentences by JDBC >>> API , so don't commit current transaction (managed by application >>> server). >>> What do you think ? >>> >>> >>> >>> >>> 2008/10/3 Jeff Butler : >>>> iBATIS will not call commit() if you have >>>> >>>> >>>> ... >>>> >>>> >>>> I'm guessing this is NOT what you have configured - but it would be >>>> nice to see your configuration. >>>> >>>> Jeff Butler >>>> >>>> On Fri, Oct 3, 2008 at 1:44 PM, Chema wrote: >>>>> I can't upgrade because my application runs over JVM 1.4 and iBatis >>>>> 2.3.0 is the last release compatible with JVM 1.4 >>>>> >>>>> About your question, from documentation: >>>>> >>>>> "The element also allows an optional attribute >>>>> commitRequired that can be true or >>>>> false. Normally iBATIS will not commit transactions unless an insert, >>>>> update, or delete operation has been performed >>>>> [...] >>>>> The startTransaction(), commitTransaction() and endTransaction() >>>>> methods, they will all be called >>>>> automatically for you whenever you execute a statement outside of a >>>>> transactional block as demonstrated in >>>>> the above." >>>>> >>>>> I think it's not by cause of my configuration >>>>> >>>>> Thanks ! >>>>> >>>>> Regards >>>>> >>>>> >>>>> >>>>> >>>>> 2008/10/3 Kai Grabfelder : >>>>>> sqlMap.delete() performs a commit? That should not be the case if the tx manager is configured correctly. >>>>>> Whats your configuration? Could you please also try updating ibatis to 2.3.4, 2.3.0 is really old... >>>>>> >>>>>> Regards >>>>>> >>>>>> Kai >>>>>> >>>>>> --- Original Nachricht --- >>>>>> Absender: Chema >>>>>> Datum: 03.10.2008 15:01 >>>>>>> That doesn't work because sqlMap.delete() performs commit automatically. >>>>>>> I'm using the transaction manager of JBoss , with JNDI/JDBC. >>>>>>> Can I disabled this ? By code is not possible because Jboss TX manager >>>>>>> throws a SQLExeception. >>>>>>> Another w/a ? >>>>>>> >>>>>>> Thanls ! >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> 2008/10/3 Kai Grabfelder : >>>>>>>> if you are using CTM (container managed transactions), like in your case, you can't start, commit or end >>>>>>>> transactions manually. The container is doing this for you. >>>>>>>> >>>>>>>> The following should work >>>>>>>>> sqlMap.delete("deleteRecords", param); >>>>>>>> >>>>>>>> If it does not I think your sqlmap configuration is not correct. Could you post it here? >>>>>>>> >>>>>>>> Regards >>>>>>>> >>>>>>>> Kai >>>>>>>> >>>>>>>> --- Original Nachricht --- >>>>>>>> Absender: Chema >>>>>>>> Datum: 03.10.2008 12:53 >>>>>>>>> Hello: >>>>>>>>> >>>>>>>>> I'm using JBoss 3.2 and EJB 2.0 with iBatis 2.3.0 >>>>>>>>> I've got configured a external transaction manager in SQLMap >>>>>>>>> configuration file. >>>>>>>>> >>>>>>>>> When an EJB component ( session bean ) tries to delete record using by >>>>>>>>> iBatis sqlMap client, JBoss retrieve this >>>>>>>>> error: >>>>>>>>> >>>>>>>>> 11:02:09,406 ERROR [Connection] Error calling Connection.commit: >>>>>>>>> java.sql.SQLException: You cannot commit during a managed transaction! >>>>>>>>> at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:525) >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> This error happens when I perform this >>>>>>>>> >>>>>>>>> sqlMap.startTransaction(); >>>>>>>>> sqlMap.delete("deleteRecords", param); >>>>>>>>> sqlMap.commitTransaction(); >>>>>>>>> sqlMap.endTransaction(); >>>>>>>>> >>>>>>>>> >>>>>>>>> And with a single call (automatic transaction): >>>>>>>>> >>>>>>>>> sqlMap.delete("deleteRecords", param); >>>>>>>>> >>>>>>>>> >>>>>>>>> I would like to delegate all transaction issues to external >>>>>>>>> transaction manager ( in this case, JBoss) >>>>>>>>> How I can solved this ? Any w/a ? >>>>>>>>> >>>>>>>>> >>>>>>>>> Thanks !! >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> > >