Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 41431 invoked from network); 26 Apr 2007 10:05:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Apr 2007 10:05:00 -0000 Received: (qmail 39919 invoked by uid 500); 26 Apr 2007 10:05:05 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 39891 invoked by uid 500); 26 Apr 2007 10:05:04 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 39878 invoked by uid 99); 26 Apr 2007 10:05:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 03:05:04 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of Jens.Mayer1@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 26 Apr 2007 03:04:55 -0700 Received: (qmail 25841 invoked by uid 0); 26 Apr 2007 10:04:34 -0000 Received: from 213.39.248.107 by www068.gmx.net with HTTP; Thu, 26 Apr 2007 12:04:34 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" Date: Thu, 26 Apr 2007 12:04:34 +0200 From: "Jens Mayer" Message-ID: <20070426100434.129910@gmx.net> MIME-Version: 1.0 Subject: user-defined transactions To: user@cayenne.apache.org X-Authenticated: #24845197 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1+0JdFjOZC0DVUk0dFKU2J/ovYGZNybhSZsazhfoQ KgFfivej1AR5qKwdblIga91Bz5DLKDIKUuhg== Content-Transfer-Encoding: 7bit X-GMX-UID: BksHcdZLbGInSvRtFmVnRdRvcmZ1ZpzP X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am not sure if I understood the concept of user-defined transaction: I am accessing two different db-schemas at the same time, using two DataDomains, one for each schema. Now I want to update data (synchronously) on both schemas with my own user-defined transaction-scope. I have to use two different transactions, one for each Domain. So that's my plan to handle the transactions: Transaction tx1 = domain1.createTransaction(); Transaction tx2 = domain2.createTransaction(); Transaction.bindThreadTransaction(tx1); Transaction.bindThreadTransaction(tx2); (Here is the first question: is it possible to bind two different transactions to the same thread?) try { ... doing some work on both schemas through SQLTemplates ... // success tx1.commit(); tx2.commit(); } catch (Exception ex) { // error tx1.setRollbackOnly(); tx2.setRollbackOnly(); } finally { Transaction.bindThreadTransaction(null); // hmm... does that means that both Transactions were unbind? if ((tx1.getStatus() == Transaction.STATUS_MARKED_ROLLEDBACK) || (tx2.getStatus() == Transaction.STATUS_MARKED_ROLLEDBACK)) { try { tx1.rollback(); tx2.rollback(); } catch (Exception ex1) { ... } } } Any help appreciated Jens -- "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail