Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 42921 invoked from network); 27 May 2009 11:53:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 May 2009 11:53:43 -0000 Received: (qmail 80429 invoked by uid 500); 27 May 2009 11:53:55 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 80326 invoked by uid 500); 27 May 2009 11:53:55 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 80234 invoked by uid 99); 27 May 2009 11:53:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 11:53:54 +0000 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 brightnesslevels@gmail.com designates 209.85.218.213 as permitted sender) Received: from [209.85.218.213] (HELO mail-bw0-f213.google.com) (209.85.218.213) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 11:53:46 +0000 Received: by bwz9 with SMTP id 9so4612205bwz.43 for ; Wed, 27 May 2009 04:53:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=/nG4cCzGdYTs5xVro2z+vpOXcZR7c8U0dxcxHwxjDrU=; b=b+BFsJuC/Mt+JrCjYSHEk1a7fCarWmsK4/s4D2Caqmi5kL3dAoaAgd5wh4Bt/MFT/T n8PBxDmzT2iJSGkJ4bKDW4nik5dw0MvSvyI6FfQ8hyDyCmlEM+4+IJG67A9zR4r8HZo1 4bLjrZwKdC1iHu5lZHwS4CGRVjFrAgoVpaFaI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=mShf0LS+E3CHgafiaMGLWtKldBIBBoWRNfhFWqKo3Mqbhh7LZXqgSFbX8GGL+ORd4B 0WBsJ7AtcjScm4yIbrV2eELZKfVgh4Zr+nCmLnBj4/Kmal+L9NBzd7QGGXyKsUlxlbzL Z/ksOUWOHub09ZOES4VUKnI5JuvSOgOV39Blg= MIME-Version: 1.0 Received: by 10.239.137.69 with SMTP id k5mr648951hbk.111.1243425204085; Wed, 27 May 2009 04:53:24 -0700 (PDT) In-Reply-To: <6248F687D9D2504B8EF10DA7AA6955B6010082627FCC@HEX-CLUSTERING.hex2007.local> References: <6248F687D9D2504B8EF10DA7AA6955B6010082627F7E@HEX-CLUSTERING.hex2007.local> <510143ac0905270247x65f747fftcfdbbf25ff8a86fa@mail.gmail.com> <6248F687D9D2504B8EF10DA7AA6955B6010082627FCC@HEX-CLUSTERING.hex2007.local> From: Sergey Podatelev Date: Wed, 27 May 2009 15:53:04 +0400 Message-ID: <8752ef10905270453j38189c66n82cf9326c4e5bc46@mail.gmail.com> Subject: Re: How to handle XA Transactions? To: users@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Check this out: http://th1rty7.blogspot.com/2009/03/spring-distributed-transactions-across.= html On Wed, May 27, 2009 at 3:39 PM, Peter Henzler wrote: > Hi Jukka > > Thank you for the reply. > >> The sessions you get from the Repository.login() method from >> Jackrabbit implement the org.apache.jackrabbit.api.XASession >> interface, whose getXAResource() method can be used to attach the >> session to a distributed XA transaction. > >> The nice thing about the JCA packaging is that it handles the >> XAResource part automatically for you, but there's nothing stopping >> you from doing the same with a little bit of code also in other >> deployment scenarios. > > Do you mean code like this?: > > =A0 =A0 =A0 =A0Transaction tx =3D tm.getTransaction(); // get the running= javax.transaction.Transaction > =A0 =A0 =A0 =A0XASession session =3D (XASession)repository.login(creds, r= ename); > =A0 =A0 =A0 =A0XAResource res =3D session.getXAResource(); > =A0 =A0 =A0tx.enlistResource(res); > =A0 =A0 =A0 =A0// do changes in repository through the session interface > =A0 =A0 =A0session.logout(); > =A0 =A0 =A0tx.delistResource(res, XAResource.TMSUCCESS); > > Or what code do you mean? > > Would that be enough for committing the repository changes when the globa= l container managed XA Transaction with changes of other database connectio= ns get commited or to get rollbacked if one of those others throws an exept= ion? > > > > > >>> If I am using the Jackrabbit Datastore and Persistence configured with = an XA >>> JDBC-Driver, do I really need Transactions in Jackrabbit. Wouldn't the = XA >>> JDBC-Driver work in a 2phase commit handled by the installed JTA >>> TransactionManager ? > >>No. Jackrabbit expects to be in full control of the underlying >>database connection, so having it included in an externally managed >>transaction is not a good idea. We've seen quite a few problems caused >>by this. > > Ok, I unterstand that Jackrabbit want it's own database connection that i= s not used by anyone else. > You mean that the configured JDBC Driver for the Jackrabbit repository sh= ould be a normal JDBC Driver instead of a XA JDBC Driver? > > Best regards > Peter > --=20 sp