Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 32173 invoked from network); 25 Jul 2007 09:37:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2007 09:37:52 -0000 Received: (qmail 58622 invoked by uid 500); 25 Jul 2007 09:37:51 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 58595 invoked by uid 500); 25 Jul 2007 09:37:51 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 58585 invoked by uid 99); 25 Jul 2007 09:37:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 02:37:51 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [62.192.10.254] (HELO goobak01.day.com) (62.192.10.254) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 02:37:49 -0700 Received: by goobak01.day.com (Postfix, from userid 1212) id E39ED50871; Wed, 25 Jul 2007 11:32:21 +0200 (CEST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by goobak01.day.com (Postfix) with ESMTP id 55BF45086E for ; Wed, 25 Jul 2007 11:32:21 +0200 (CEST) Received: by wa-out-1112.google.com with SMTP id k40so170169wah for ; Wed, 25 Jul 2007 02:37:06 -0700 (PDT) Received: by 10.114.254.1 with SMTP id b1mr443560wai.1185356226430; Wed, 25 Jul 2007 02:37:06 -0700 (PDT) Received: by 10.114.190.8 with HTTP; Wed, 25 Jul 2007 02:37:06 -0700 (PDT) Message-ID: Date: Wed, 25 Jul 2007 11:37:06 +0200 From: "Dominique Pfister" Sender: dpfister@day.com To: dev@jackrabbit.apache.org Subject: Re: Questions about TX in Jackrabbit, JTA and Spec compliance In-Reply-To: <46A6058B.3080901@consol.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4691F684.4080703@consol.de> <46A6058B.3080901@consol.de> X-Google-Sender-Auth: 638d19ff08b9a108 X-Virus-Checked: Checked by ClamAV on apache.org Hi Marcel, On 7/24/07, Marcel May wrote: > Jackrabbit JCA basically wraps Jackrabbit Core, but still all the Core > PersistenceManager and FileSystem implementations > are used. These, as you mentioned as well, use and manager their own > JDBC connections and therefore can never be JTA/XA compliant: > > - JTA/XA requires using a (distributed) transaction manager > - Jackrabbit directly invokes setAutoCommit/commit/rollback without a > transaction manager (illegal in JTA/XA terms!) > - Jackrabbit Workspace with a DB FileSystem and DB PersistenceManager > have two separate configured connections w/o a transaction manager. > > Example: > - If Jackrabbit rolls back a TX directly on a connection, the > distributed transaction will not know about this. > - If the distributed TX is rolled back, Jackrabbit might already have > invoked con.commit() ... therefore no > rollback is possible. When using Jackrabbit JCA, every repository operation made on behalf of a distributed transaction is recorded in a "change log", something not associated with the JDBC connection used normally. This change log will not be persisted on invididual "save" calls, but only when the respective method calls on the XAResource interface, exposed by Jackrabbit JCA, are invoked. Therefore, I don't think the situations you describe are actually encountered. > Spec says a JCR impl can support TXs, and if it supports TXs it must > support JTA. Right? I'd say so. > The Jackrabbit impl. can not be transactional on workspace level if > internally a > database PersistenceManager and a databasse FileSystem each have their > own database connection: > An operation spawns the persistence manager (=pm) and the filesystem > (=fm), right? > If one part (fm/pm) succeeds and is commited, the other part (fm/pm) > might fail and > therefore violate the ACID principle? > How do the two db connections of PM and FS work together? > This IMO can only be managed by JTA/XA. AFAIK, the FS is mainly used for configuration purposes and therefore plays an important role on startup. PM, on the other side, is the one used when it comes to saving content in the repository. You're right, that a combination of PM/FS operations is conceivable where one side reports success and the other doesn't, but that shouldn't happen in real life. Again, when using Jackrabbit JCA, every operation that could potentially end up in a JDBC call writing some data, is rather logged to some internal storage and only executed when the distributed transaction is committed. It is only at that point in time, that all changes are written at one time using the PM's JDBC connection. Cheers Dominique > P.S.: I'd be willing to provide a documentation patch at the end of this discussion :-) Always happy to find some volunteers :-)