WebLogic Execute transaction recover encounter strange problems

Source: Internet
Author: User
Tags commit prepare resource rollback oracle database

These days to do transaction recover test, found a difficult to understand the problem.

The specific problem scenario is as follows:

1: A standby client program that calls Usertransaction.begin () and then operates in sequence two XA resource, two resource for the same Oracle database, However, the operation uses connection from different data source. Connection1 inserts a piece of data into the table test, Connection2 inserts a piece of data into the table test1. The final execution of Usertransaction.commit ().

When 2:usertransaction.commit () executes, a two-phase commit is required, first the global prepare, and if all resource are prepare OK, WebLogic writes the TX record ( Written to TLog). Then execute the global commit. During the test, after the global prepare is executed, set the break point at the global commit and stop the database. When the database is stopped, the break point of the global commit is removed, and WebLogic needs to issue a commit to each resource. Because some resource are unavailable at this time, WebLogic cannot receive a response from each resource commit, which is kept in TLog until the server is reset recover.

3: In accordance with the normal logic of the global prepare completion, the TX should be only commit, but not rollback, but found in the test, WebLogic in recover, will go rollback this TX.

The following is the data information that is recorded in the test.

1: After the database is WebLogic, you can see that the TX information in the DB is as follows:

The information in the 2:weblogic TLog,

+------------------------------------------------------------------------------+
| Transaction Log Dump |                                                       |
+------------------------------------------------------------------------------+
| Class Name = weblogic.transaction.internal.ResourceCheckpoint                |
| Object = ResourceCheckpoint={OracelXADS, OracleXADS1}                        |
+------------------------------------------------------------------------------+

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.