Claims
- 1. An improved method for providing two-phase commit protocol (2PC) in a transaction processing system in communication with at least two databases, the method comprising:
in response to a transaction initiated by a client, allocating connections to databases participating in said transaction without use of 2PC; reading in records required in said transaction from said databases; determining whether or not said transaction results in changes to more than one database; if said transaction results in changes to no more than one database, completing said transaction without use of 2PC; and if said transaction results in changes to more than one database, using 2PC to complete said transaction.
- 2. The method of claim 1, wherein said databases include file systems.
- 3. The method of claim 1, wherein said databases include other resource managers.
- 4. The method of claim 1, wherein said connections initially allocated to said databases participating in said transaction comprise non-XA connections.
- 5. The method of claim 1, wherein XA connections are only allocated to said databases participating in said transaction when it has been determined that said transaction results in changes to more than one database.
- 6. The method of claim 1, wherein 2PC is not used if said transaction involves only reading of data.
- 7. The method of claim 1, wherein non-XA connections are used if said transaction involves only reading of data.
- 8. The method of claim 1, wherein 2PC is not used if said transaction involves only changes to one of said databases.
- 9. The method of claim 1, wherein non-XA connections are used if said transaction involves changes to only one of said databases.
- 10. The method of claim 1, wherein said transaction processing system comprises at least a three-tier system including at least one client, a middle-tier application server, and at least two databases.
- 11. The method of claim 10, wherein said middle-tier application server determines whether said transaction requires use of 2PC.
- 12. The method of claim 10, wherein said middle-tier application server manages a pool of XA connections and non-XA connections to said participating databases.
- 13. The method of claim 10, wherein said middle-tier application server determines if said transaction requires use of XA connections.
- 14. The method of claim 10, wherein said middle-tier application server includes a persistence manager that determines whether said transaction requires use of 2PC.
- 15. The method of claim 10, wherein said middle-tier application server coordinates use of 2PC if said transaction results in changes to more than one database.
- 16. The method of claim 10, wherein said middle-tier application server invokes a transaction manager if said transaction results in changes to more than one database.
- 17. The method of claim 16, wherein said transaction manager assigns an XA identifier only when said transaction is determined to result in changes to more than one database.
- 18. The method of claim 16, wherein said transaction manager uses 2PC to complete said transaction.
- 19. The method of claim 16, wherein said transaction manager serves as a transaction coordinator for completion of said transaction using 2PC.
- 20. The method of claim 10, wherein said middle-tier application server includes a persistence manager controlling reading and writing of data to said databases.
- 21. The method of claim 20, wherein said persistence manager determines whether said transaction results in changes to more than one database before writing any data.
- 22. The method of claim 20, wherein said persistence manager uses 2PC for writing data only when said transaction results in changes to more than one database.
- 23. The method of claim 20, wherein said persistence manager obtains XA connections to said databases if said transaction results in changes to more than one database.
- 24. The method of claim 20, wherein said persistence manager uses non-XA connections to said participating databases if said transaction does not result in changes to more than one database.
- 25. The method of claim 1, wherein said step of determining whether or not said transaction results in changes to more than one database includes the substeps of:
making changes resulting from said transaction in temporary space; and evaluating said changes to determine if said transaction results in changes to more than one database.
- 26. The method of claim 1, wherein said step of determining whether or not said transaction results in changes to more than one database is made before said changes are written to said databases.
- 27. The method of claim 1, wherein said step of determining whether or not said transaction results in changes to more than one database is made before said changes are committed to said databases.
- 28. The method of claim 1, wherein said step of determining whether or not said transaction results in changes to more than one database is made as changes are being written to said databases and before said changes are committed to said databases.
- 29. The method of claim 1, wherein said step of using 2PC to complete said transaction includes the substeps of:
obtaining XA connections to all databases participating in said transaction; assigning an XA identifier for said transaction; initiating writing of said changes to said participating databases using XA connections; polling said participating databases to determine if all said databases can commit said changes; if all said databases respond affirmatively, instructing all said databases to commit said changes and complete said transaction; and if at least one of said databases does not respond affirmatively, instructing all said databases to roll back said changes.
- 30. The method of claim 29, further comprising:
upon determining that said transaction requires use of 2PC, rereading all data records prior to initiating changes to said participating databases.
- 31. The method of claim 29, further comprising:
upon determining that said transaction requires use of 2PC, rereading a portion of the data records prior to initiating changes to said participating databases.
- 32. An improved method for providing two-phase commit protocol (2PC) in a transaction processing system in communication with at least two databases, the method comprising:
in response to a transaction initiated by a client, performing a read portion of said transaction by performing the substeps of:
obtaining data from databases participating in said transaction, and processing any changes to said data made in the transaction in temporary space; before writing said changes to said databases, determining how many databases are to be changed during a write portion of said transaction; if no more than one database is to be changed in said transaction, completing the write portion of said transaction without use of 2PC; and if more than one database is to be changed in said transaction, using 2PC to complete the write portion of said transaction.
- 33. The method of claim 32, wherein said substep of obtaining data from said databases participating in said transaction includes obtaining non-XA connections to said databases.
- 34. The method of claim 32, wherein XA connections are only obtained if said transaction results in changes to more than one database.
- 35. The method of claim 32, wherein 2PC is not used if said transaction involves only reading of data.
- 36. The method of claim 32, wherein non-XA connections are used if said transaction involves only reading of data.
- 37. The method of claim 32, wherein 2PC is not used if said transaction involves changes to only one of said databases.
- 38. The method of claim 32, wherein non-XA connections are used if said transaction involves changes to only one of said databases.
- 39. The method of claim 32, wherein said transaction processing system comprises at least a three-tier system including at least one client, a middle-tier application server, and at least two databases.
- 40. The method of claim 39, wherein said middle-tier application server determines whether said transaction requires use of 2PC.
- 41. The method of claim 39, wherein said middle-tier application server coordinates use of 2PC when said transaction results in changes to more than one database.
- 42. The method of claim 39, wherein said step of using 2PC to complete said transaction includes the substeps of:
obtaining XA connections to all databases that participate in said transaction; assigning an XA identifier for said transaction; initiating writing of said changes to said participating databases using XA connections; polling said participating databases to determine if all said databases can commit said changes; if all said databases respond affirmatively, instructing all said databases to commit said changes and complete said transaction; and if at least one of said databases does not respond affirmatively, instructing all said databases to roll back said changes.
- 43. The method of claim 42, further comprising:
upon determining that said transaction requires use of 2PC, rereading all data records prior to initiating changes to said participating databases.
- 44. The method of claim 42, further comprising:
upon determining that said transaction requires use of 2PC, rereading a portion of the data records prior to initiating changes to said participating databases.
- 45. An improved method for providing two-phase commit protocol (2PC) in a transaction processing system capable of accessing at least two databases, the method comprising:
determining whether each transaction performed in said transaction processing system may result in changes to more than one database; annotating each transaction that may result in changes to more than one database to indicate that use of 2PC is required for said each transaction; and in response to each specific transaction initiated by a client, using 2PC for transactions annotated as requiring 2PC and completing all other transactions without use of 2PC.
- 46. An improved transaction processing system for selectively using two-phase commit protocol (2PC) for transactions that access multiple databases, said system comprising:
a network providing access to databases that participate in a particular transaction; a persistence manager for determining if more than one participating database is changed in said particular transaction and initiating use of 2PC only when said particular transaction results in changes to more than one database; and a transaction manager that coordinates completion of said particular transaction, said transaction manager only employing 2PC when said persistence manager has determined that more than one participating database is changed by said particular transaction.
- 47. The system of claim 46, wherein said persistence manager makes changes required by a particular transaction in temporary space to determine whether more than one database is changed as a result of said transaction.
- 48. The system of claim 46, wherein said persistence manager controls reading and writing of data to said databases.
- 49. The system of claim 46, wherein said persistence manager determines whether said transaction results in changes to more than one database before changes are written to said databases.
- 50. The system of claim 46, wherein said persistence manager determines whether said transaction results in changes to more than one database before changes are committed to said databases.
- 51. The system of claim 46, wherein said persistence manager determines whether or not said transaction results in changes to more than one database as changes are being written to said databases and before said changes are committed to said databases.
- 52. The system of claim 46, wherein said transaction manager assigns an XA identifier for said particular transaction, when said particular transaction results in changes to more than one database.
- 53. The system of claim 46, further comprising:
a connection manager maintaining a pool of XA and non-XA connections to said participating databases.
- 54. The system of claim 53, wherein said transaction manager only obtains XA connections to said databases from said connection manager when said persistence manager has determined that said particular transaction results in changes to more than one database.
- 55. The system of claim 53, wherein said persistence manager initiates writing of data to the participating databases using XA connections obtained from the connection manager.
- 56. The system of claim 46, wherein said transaction manager polls each participating database to respond whether it can commit its respective changes made in said transaction and, based on responses received, instructs said databases whether to commit said changes.
- 57. The system of claim 46, in which said system comprises at least a three-tier system including at least one client, a middle-tier application server, and at least two databases.
- 58. The system of claim 57, in which said middle-tier application server includes said persistence manager.
- 59. The system of claim 57, in which said middle-tier application server includes said transaction manager.
- 60. The system of claim 57, in which said middle-tier application server includes said connection manager.
RELATED APPLICATIONS
[0001] The present application is related to and claims the benefit of priority of the following commonly-owned provisional application(s): application serial No. 60/316,827 (Docket No. BORL/0201.00), filed Aug. 31, 2001, entitled “Transaction Processing System Providing Improved Methodology For Two-Phase Commit Decision”, of which the present application is a non-provisional application thereof. The disclosure of the foregoing application is hereby incorporated by reference in its entirety, including any appendices or attachments thereof, for all purposes.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60316827 |
Aug 2001 |
US |