Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 14472 invoked from network); 17 Dec 2008 16:48:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Dec 2008 16:48:06 -0000 Received: (qmail 96494 invoked by uid 500); 17 Dec 2008 16:48:18 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 96023 invoked by uid 500); 17 Dec 2008 16:48:17 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 96008 invoked by uid 99); 17 Dec 2008 16:48:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Dec 2008 08:48:17 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Dec 2008 16:48:04 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 40155234C3B4 for ; Wed, 17 Dec 2008 08:47:44 -0800 (PST) Message-ID: <1979037113.1229532464254.JavaMail.jira@brutus> Date: Wed, 17 Dec 2008 08:47:44 -0800 (PST) From: "Lin Sun (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Updated: (GERONIMO-4471) improve heuristic exception handling in rollback when txmanager.commit is called In-Reply-To: <1898117320.1229444564313.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/GERONIMO-4471?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lin Sun updated GERONIMO-4471: ------------------------------ Description: Improve heuristic exception handling during rollback, when txmanager.commit is called by providing a rollbackResourcesDuringCommit method to throw appropriate heuristic exceptions. The logic is: 1. If XAException.XA_HEURRB arisen from XAResource rollback, this means transaction has been heuristically rolled back, thus we just throw normal RollbackException. 2. If XAException.XA_HEURMIX arisen from XAResource rollback, this means transaction has been heuristically rolled back and committed, thus we just throw HeuristicMixedException. 3. If XAException.XA_HEURCOM arisen from XAResource rollback, this means transaction has been heuristically committed. In this case, if transaction has ever been committed (via other XAResources enlisted), then we throw HeuristicMixedException. 4. Other XAExceptions, throw SystemExceptions. 5. If no specific XAException or only XAException.XA_HEURRB, throw RollbackException. The rollbackResourcesDuringCommit method will be used during the commit context instead of the current rollbackResources method. was: Improve heuristic exception handling during rollback, when txmanager.commit is called by providing a rollbackResourcesDuringCommit method to throw appropriate heuristic exceptions. The logic is: 1. If XAException.XA_HEURRB arisen from XAResource rollback, this means transaction has been heuristically rolled back, thus we just throw normal RollbackException. 2. If XAException.XA_HEURMIX arisen from XAResource rollback, this means transaction has been heuristically rolled back and committed, thus we just throw HeuristicMixedException. 3. If XAException.XA_HEURCOM arisen from XAResource rollback, this means transaction has been heuristically committed. In this case, if transaction has ever been committed (via other XAResources enlisted), then we throw HeuristicMixedException. 4. Other XAExceptions, throw SystemExceptions. 5. If no specific XAException or only XAException.XA_HEURRB, throw RollbackException. The rollbackResourcesDuringCommit method will be used during the commit context instead of the current rollbackResources method. Also, during the internalPrepare method, it has: //TODO document why this is true from the spec. //XAException during prepare means we can assume resource is rolled back. rms.remove(); I don't think this is correct. Per jta spec page 50, If the resource manager wants to roll back the transaction, it should do so by throwing an appropriate XAException in the prepare method. With that, I think we cannot assume resource is already rolled back. It is just the resource manager wants to roll back the transaction. thus I propose us remove the "rms.remove()" here, so that this rm can be included in the rollback action. Remove stuff under "Also, during the internalPrepare method, it has:", because I saw more details on this from the OTS spec, in multiple places, such as: The resource can return VoteRollback under any circumstances, including not having any knowledge about the transaction (which might happen after a crash). If this response is returned, the transaction must be rolled back. Furthermore, the Transaction Service is not required to perform any additional operations on this resource. Returning VoteRollback to prepare A Resource that replies VoteRollback has no requirement to log. Once having replied, the Resource can return recoverable resources to their prior state and forget the transaction. > improve heuristic exception handling in rollback when txmanager.commit is called > -------------------------------------------------------------------------------- > > Key: GERONIMO-4471 > URL: https://issues.apache.org/jira/browse/GERONIMO-4471 > Project: Geronimo > Issue Type: Improvement > Security Level: public(Regular issues) > Components: transaction manager > Affects Versions: 2.2 > Reporter: Lin Sun > Assignee: Lin Sun > Fix For: 2.2 > > > Improve heuristic exception handling during rollback, when txmanager.commit is called by providing a rollbackResourcesDuringCommit method to throw appropriate heuristic exceptions. The logic is: > 1. If XAException.XA_HEURRB arisen from XAResource rollback, this means transaction has been heuristically rolled back, thus we just throw normal RollbackException. > 2. If XAException.XA_HEURMIX arisen from XAResource rollback, this means transaction has been heuristically rolled back and committed, thus we just throw HeuristicMixedException. > 3. If XAException.XA_HEURCOM arisen from XAResource rollback, this means transaction has been heuristically committed. In this case, if transaction has ever been committed (via other XAResources enlisted), then we throw HeuristicMixedException. > 4. Other XAExceptions, throw SystemExceptions. > 5. If no specific XAException or only XAException.XA_HEURRB, throw RollbackException. > The rollbackResourcesDuringCommit method will be used during the commit context instead of the current rollbackResources method. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.