Commit Processing for Imported Transactions Recovery for Imported Transactions

Participating in Transactions Managed by a Third-Party Transaction Manager 12-7

12.5 Commit Processing for Imported Transactions

The foreign transaction manager should drive the interposed transaction manager in the 2PC protocol as it does the other XAResources. Note that the beforeCompletion callbacks registered with the WebLogic Server JTA for example, the EJB container are called when the foreign transaction manager prepares the interposed transaction managers XAResource. The afterCompletion callbacks are called during XAResource.commit or XAResource.rollback. The WebLogic Server interposed transaction manager honors the XAResource contract as described in the Java Transaction API at http:java.sun.comjavaeetechnologiesjtaindex.jsp . ■ Once prepared by a foreign transaction manager, the WebLogic Server interposed transaction manager waits persistently for a commit or rollback outcome from the foreign transaction manager until the transaction abandon timeout expires. ■ The WebLogic Server interposed transaction manager remembers heuristic outcomes persistently until being told to forget about the transaction by the foreign transaction manager or until transaction abandon timeout. The WebLogic Server transaction manager logs a prepare record for the imported transaction after all the WebLogic Server participants are successfully prepared. If there are multiple WebLogic Server participants for the imported transaction, the transaction manager logs a prepare record even if the XAResource.commit is a one-phase commit.

12.6 Recovery for Imported Transactions

During the crash recovery of the foreign transaction manager, the foreign transaction manager must get the XAResource of the WebLogic Server interposed transaction manager again, and call recover on it. The WebLogic Server interposed transaction manager then returns the list of prepared or heuristically completed transactions. The foreign transaction manager should then resolve those in-doubt transactions: either commit or rollback the prepared transactions, and call forget on the heuristically completed transactions. 12-8 Programming JTA for Oracle WebLogic Server 13 Troubleshooting Transactions 13-1 13 Troubleshooting Transactions This section describes troubleshooting tools and tasks for use in determining why transactions fail and deciding what actions to take to correct the problem. This section discusses the following topics: ■ Section 13.1, Overview