Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 26140 invoked from network); 4 Sep 2007 09:20:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2007 09:20:32 -0000 Received: (qmail 38087 invoked by uid 500); 4 Sep 2007 09:20:25 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 38067 invoked by uid 500); 4 Sep 2007 09:20:25 -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 38058 invoked by uid 99); 4 Sep 2007 09:20:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 02:20:25 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jan.grathwohl@kontrast.de designates 217.69.78.1 as permitted sender) Received: from [217.69.78.1] (HELO kontrast.de) (217.69.78.1) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 09:21:35 +0000 Received: from [192.168.223.199] (HELO [192.168.111.52]) by kontrast.de (CommuniGate Pro SMTP 5.1.4) with ESMTPS id 5556639 for users@jackrabbit.apache.org; Tue, 04 Sep 2007 11:22:50 +0200 Mime-Version: 1.0 (Apple Message framework v752.3) To: Jackrabbit Users List Message-Id: <4CB71494-AAD6-4E65-B686-3F3DA593EBE0@kontrast.de> Content-Type: multipart/alternative; boundary=Apple-Mail-3-137002262 From: Jan Grathwohl Subject: Transaction over multiple workspaces? Date: Tue, 4 Sep 2007 11:19:59 +0200 X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-3-137002262 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hi, is it possible in Jackrabbit to have a transaction that spans multiple workspaces? What I would like to do is to start a UserTransaction, write changes to several Jackrabbit workspaces (all from the same repository) and a Hibernate session, and then commit all these changes together. My application modifies several workspaces concurrently, and I would like to ensure that all these changes are either commited or rolled back completely. I have set up a JCA deployment of Jackrabbit 1.3.1 in JBoss , and it works fine as long as I only use one session per transaction. It looks from my tests like it is not possible to open more than one session within a transaction, and I also found a thread on the mailing list that says something like that. But if I want to work in multiple workspaces, I have to open multiple sessions, because session are always per-workspace, right? So my code to edit multiple workspaces within one transaction would be InitialContext ctx = new InitialContext(); UserTransaction utx = (UserTransaction)ctx.lookup("java:comp/ UserTransaction"); utx.begin(); Repository repo = (Repository)ctx.lookup("java:jcr/local"); Session session1 = repo.login(new SimpleCredentials("admin", "admin".toCharArray()), "workspace1"); Session session2 = repo.login(new SimpleCredentials("admin", "admin".toCharArray()), "workspace2"); // Use session1 to write changes to workspace1 // Use session2 to write changes to workspace2 session1.save(); session2.save(); utx.commit(); which doesn't work. Is there any way to include multiple workspaces within the scope of one transaction? Thank you. Jan --Apple-Mail-3-137002262--