1 / 40

DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?

DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?. Deb Walz Principal Software Engineer. JTA Transactions in the RDBMS. JTA Overview Changes to database engine Planning for JTA support Monitoring JTA Transactions. Under Development.

robbin
Download Presentation

DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DB-16: JTA Transactions in the RDBMS, What's Going on Down There? Deb Walz Principal Software Engineer

  2. JTA Transactions in the RDBMS • JTA Overview • Changes to database engine • Planning for JTA support • Monitoring JTA Transactions DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  3. Under Development D I S C L A I M E R D I S C L A I M E R • This talk includes information about potential future products and/or product enhancements. • What I am going to say reflects our current thinking, but the information contained herein is preliminary and subject to change. Any future products we ultimately deliver may be materially different from what is described here. DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  4. What is JTA? • Java™ Transaction API • Part of Sun’s Java 2 Platform, Enterprise Edition (J2EE) Reference Architecture • Supports SQL Two-Phase Commit (2PC) through JDBC DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  5. J2EE Architecture Applet Container J2SE Web Container J2SE EJB Container J2SE EJB JSP Java Mail Java Mail JDBC JDBC JTA JTA JMS JMS JAAS JAAS JAXP JAXP Connector Connector Database JAF JAF Application Client Container J2SE Servlet Application Client Applet JMS JAAS JAXP JDBC HTTP SSL HTTP SSL DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  6. JTA Architecture EJB JTA TransactionManager JDBC, JMS Application Server Transaction Manager JTA UserTransaction JTA XAResource Resource Manager Application DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  7. Two-Phase Commit Protocol OpenEdge Prepare to Commit Transaction Manager Oracle Ready to Commit OpenEdge OpenEdge Commit Transaction Manager Complete Oracle OpenEdge • Prepare Phase • Resolution Phase DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  8. JTA XAResource Methods • start (xid, …) • end (xid, …) • prepare (xid) • commit (xid, …) • rollback (xid) • recover(…) DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  9. JDBC Code Snippets - 1 xaRes.start(xid, TMNOFLAGS); . . . xaRes.end(xid, TMSUCCESS); xaRes.prepare(xid); xaRes.commit(xid, false); DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  10. JDBC Code Snippets - 2 xaRes.start(xid1, TMNOFLAGS); ... xaRes.end(xid1, TMSUSPEND); ... xaRes.start(xid1, TMRESUME); ... xaRes.end(xid1, TMSUCCESS); DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  11. xaRes.start(xid1); ... xaRes.end(xid1); ... xaRes.start(xid1,TMJOIN); ... xaRes.end(xid1); JDBC Code Snippets - 3 Connection #1 Connection #2 DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  12. JDBC Code Snippets - 4 ... xaRes.start(xid2); ... xaRes.prepare(xid1); ... xaRes.end(xid2); DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  13. Where Do I Learn More about JTA? • http://java.sun.com/j2ee/index.jsp • http://java.sun.com/products/jta/ • http://www.datadirect.com/developer/jdbc/topics/jta/index.ssp DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  14. JTA Transactions in the RDBMS • JTA Overview • Changes to database engine • Planning for JTA support • Monitoring JTA Transactions DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  15. Database Changes • New type of transaction • Data structure changes • Crash Recovery changes • Lock Manager changes DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  16. JTA Transactions • Controlled by external transaction manager • May be associated with more than one database connection • Once prepared, they withstand shutdown • Peaceably co-exist with traditional transactions DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  17. Data Structures – Traditional Transactions Transaction Id State User Id Time Started Flags User List Transaction List Transaction Table Entry DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  18. Data Structures – JTA Transactions JTA XID State Transaction Id Active User Id Idle Locks Transaction Id State User Id Time Started Trad’l Flags Pointer to JTA JTA (XID) List User List Transaction List JTA Entry Transaction Table Entry DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  19. Crash Recovery Changes • New Lock Application Phase • Presence of Lock Table • New BI Notes • Effect on database utilities DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  20. Crash Recovery - Review • Redo Phase • Undo Phase • Physical Undo • Logical Undo DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  21. Crash Recovery – New Lock Application Phase No Outstanding Prepared JTA Transactions Thu Mar 24 17:15:52 2005 Multi-user session begin. (333) Begin Physical Redo Phase at 0 . (5326) Physical Redo Phase completed … (7161) Begin JTA Lock Application End JTA Lock Application … DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  22. New Lock Acquisition Phase – after database crash Thu Mar 24 18:21:22 2005 Multi-user session begin. (333) Begin Physical Redo Phase … (5326) Physical Redo Phase Completed … (7161) Begin JTA Lock Application End JTA Lock Application Begin Physical Undo 2 Transactions … (7163) Physical Undo 1 Live JTA Transactions detected Physical Undo Phase Completed … (5331) Begin Logical Undo Phase, 1 incomplete transactions are being backed out. (7162) Logical Undo Phase begin … (11231) Logical Undo: 1 Live JTA Transaction detected Logical Undo Phase Completed … (12095) Logical Undo: 1 Live JTA Transactions active DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  23. RL_TBGN RL_CXINS RL_RMCR RL_TEND RL_GTBGN RL_XID RL_TBLLK RL_CXINS RL_RMCR RL_GEND RL_GPREP RL_GTEND Crash Recovery – New BI Notes Traditional Transaction 4GL 2PC Transaction JTA Transaction RL_TBGN RL_CXINS RL_RMCR RL_RCOMM RL_TEND DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  24. Crash Recovery – Effect on Database Utilities The database contains limbo transactions. (2043) See list on the log file .lg. Use PROUTIL <db> -C 2phase recover. (2042) ** The server exited with error code 20. (800) Redo Phase: JTA Transaction: <xid> in state: Prepared (12572) Redo Phase: JTA Transactions must access crash recovery through a multi-user process (12573) DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  25. Lock Manager Changes • Locks are owned by transaction • Locks are restored during crash recovery • Locks may be present on start up • If JTA Transactions in prepared state DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  26. Lock Manager Data Structures JTA XID State Transaction Id User Id Locks JTA (XID) List JTA Entry Lock Entries … DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  27. JTA Transactions in the RDBMS • JTA Overview • Changes to database engine • Planning for JTA support • Monitoring JTA Transactions DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  28. Planning for JTA Support • Enabling JTA Support • Space allocation • Startup Parameters DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  29. Enabling JTA Support • proutil <dbname> –C enablejta • Disables after-imaging (if enabled) • proutil <dbname> -C disablejta DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  30. Space Allocation • More notes implies more BI and AI space needed DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  31. Startup Parameters • -maxxids • -L • -bithreshold • Standard performance tuning • -bibufs • -B DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  32. JTA Transactions in the RDBMS • JTA Overview • Changes to database engine • Planning for JTA support • Monitoring JTA Transactions DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  33. Lock Table Display Pre-JTA: Usr Name Chn # Recid Tbl Lock Flags 5 deb REC 6 3712 5 SHR L 6 carol REC 7 3713 5 SHR L 7 rich REC 8 3714 5 SHR L 8 george REC 9 3715 5 SHR L Usr Name Chn # Recid Tbl Lock Flags Trans JTA 5 deb REC 6 3712 5 SHR 123 Yes - - REC 7 3713 5 SHR 142 Yes 7 rich REC 8 3714 5 SHR No 8 george REC 9 3715 5 SHR L 214 No With JTA Support: With JTA Support: With JTA Support: Usr Name Chn # Recid Tbl Lock Flags Trans JTA 5 deb REC 6 3712 5 SHR 123 Yes - - REC 7 3713 5 SHR 142 Yes 7 rich REC 8 3714 5 SHR No 8 george REC 9 3715 5 SHR L 214 No Usr Name Chn # Recid Tbl Lock Flags Trans JTA 5 deb REC 6 3712 5 SHR 123 Yes - - REC 7 3713 5 SHR 142 Yes 7 rich REC 8 3714 5 SHR No 8 george REC 9 3715 5 SHR L 214 No DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  34. Shared Resources Display Current size of locking table (-L): 8192 Locking table entries in use: 691 Locking table high water mark: 692 Max clients per server (-Ma): 5 Max JTA transactions (-maxxids): 200 Delay of before-image flush (-Mf): 3 DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  35. Active Transactions Display Usr Name Login Time Tx start Tx Id Tx State 5 dwalz <T1> <T2> 178 Active JTA - - <T3> <T4> 183 Idle JTA • Active JTA • Idle JTA • Prepared JTA • Rollback Only JTA DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  36. Resolve JTA Transactions • Commit a JTA Transaction • Rollback a JTA Transaction • Quit Don't do it!! DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  37. In Summary JTA Transactions in the RDBMS • JTA Overview • Database Changes • New transaction type • Crash Recovery Changes • Lock Manager Changes • Planning for JTA • Monitoring Enhancements DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  38. Questions? DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  39. Thank you for your time! DB-16 JTA Transactions in the RDBMS, What's going on Down There?

  40. DB-16 JTA Transactions in the RDBMS, What's going on Down There?

More Related