Download presentation
Presentation is loading. Please wait.
Published byHenry Johnston Modified over 9 years ago
1
DB-16 : JTA Transactions in the RDBMS, What's Going on Down There? Deb Walz Principal Software Engineer
2
2© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? JTA Transactions in the RDBMS n JTA Overview n Changes to database engine n Planning for JTA support n Monitoring JTA Transactions
3
3© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? D I S C L A I M E R Under Development n This talk includes information about potential future products and/or product enhancements. n 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. D I S C L A I M E R
4
4© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? What is JTA? n Java™ Transaction API n Part of Sun’s Java 2 Platform, Enterprise Edition (J2EE) Reference Architecture n Supports SQL Two-Phase Commit (2PC) through JDBC
5
5© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? J2EE Architecture Application Client Container J2SE Application Client JMSJAAS JAXP JDBC Applet Container J2SE Applet Web Container J2SE JMSJAAS JAXP JTA Connector JDBC Java Mail JAF JSP Servlet HTTP SSL HTTP SSL EJB Container J2SE EJB JMSJAAS JAXP JTA Connector JDBC Java Mail JAF Database
6
6© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? JTA Architecture JTA UserTransaction Application Server Application Resource Manager Transaction Manager EJB JTA XAResource JTA TransactionManager JDBC, JMS
7
7© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? n Prepare Phase Two-Phase Commit Protocol Transaction Manager Oracle OpenEdge Prepare to Commit Ready to Commit n Resolution Phase Transaction Manager Oracle OpenEdge Commit Complete
8
8© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? JTA XAResource Methods n start (xid, …) n end (xid, …) n prepare (xid) n commit (xid, …) n rollback (xid) n recover(…)
9
9© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? JDBC Code Snippets - 1 xaRes.start(xid, TMNOFLAGS);... xaRes.end(xid, TMSUCCESS); xaRes.prepare(xid); xaRes.commit(xid, false);
10
10© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? JDBC Code Snippets - 2 xaRes.start(xid1, TMNOFLAGS);... xaRes.end(xid1, TMSUSPEND);... xaRes.start(xid1, TMRESUME);... xaRes.end(xid1, TMSUCCESS);
11
11© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? JDBC Code Snippets - 3 xaRes.start(xid1);... xaRes.end(xid1);... xaRes.start(xid1,TMJOIN);... xaRes.end(xid1); Connection #1 Connection #2
12
12© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? JDBC Code Snippets - 4... xaRes.start(xid2);... xaRes.prepare(xid1);... xaRes.end(xid2);
13
13© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Where Do I Learn More about JTA? n http://java.sun.com/j2ee/index.jsp http://java.sun.com/j2ee/index.jsp n http://java.sun.com/products/jta/ http://java.sun.com/products/jta/ n http://www.datadirect.com/developer/jdbc/topics/jta/index.ssp
14
14© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? n JTA Overview n Changes to database engine n Planning for JTA support n Monitoring JTA Transactions JTA Transactions in the RDBMS
15
15© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Database Changes n New type of transaction n Data structure changes n Crash Recovery changes n Lock Manager changes
16
16© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? n Controlled by external transaction manager n May be associated with more than one database connection n Once prepared, they withstand shutdown n Peaceably co-exist with traditional transactions JTA Transactions
17
17© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Transaction List User List Data Structures – Traditional Transactions Transaction Table Entry Transaction Id State User Id Time Started Flags
18
18© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Data Structures – JTA Transactions Transaction Id State User Id Time Started Pointer to JTA Flags JTA XID State Transaction Id User Id Locks JTA Entry JTA (XID) List Active Idle Trad’l Transaction List User List Transaction Table Entry
19
19© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Crash Recovery Changes n New Lock Application Phase n Presence of Lock Table n New BI Notes n Effect on database utilities
20
20© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Crash Recovery - Review n Redo Phase n Undo Phase –Physical Undo –Logical Undo
21
21© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? 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 …
22
22© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? 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 New Lock Acquisition Phase – after database crash
23
23© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Crash Recovery – New BI Notes RL_TBGN RL_CXINS RL_RMCR RL_TEND Traditional Transaction RL_TBGN RL_CXINS RL_RMCR RL_RCOMM RL_TEND 4GL 2PC Transaction RL_GTBGN RL_XID RL_TBLLK RL_CXINS RL_RMCR RL_GEND RL_GPREP RL_GTEND JTA Transaction
24
24© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Crash Recovery – Effect on Database Utilities Redo Phase: JTA Transaction: in state: Prepared (12572) Redo Phase: JTA Transactions must access crash recovery through a multi-user process (12573) The database contains limbo transactions. (2043) See list on the log file.lg. Use PROUTIL -C 2phase recover. (2042) ** The server exited with error code 20. (800)
25
25© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Lock Manager Changes n Locks are owned by transaction n Locks are restored during crash recovery n Locks may be present on start up –If JTA Transactions in prepared state
26
26© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Lock Manager Data Structures JTA XID State Transaction Id User Id Locks JTA Entry JTA (XID) List Lock Entries …
27
27© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? n JTA Overview n Changes to database engine n Planning for JTA support n Monitoring JTA Transactions JTA Transactions in the RDBMS
28
28© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Planning for JTA Support n Enabling JTA Support n Space allocation n Startup Parameters
29
29© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Enabling JTA Support n proutil –C enablejta –Disables after-imaging (if enabled) n proutil -C disablejta
30
30© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Space Allocation n More notes implies more BI and AI space needed
31
31© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Startup Parameters n -maxxids n -L n -bithreshold n Standard performance tuning –-bibufs –-B
32
32© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? n JTA Overview n Changes to database engine n Planning for JTA support n Monitoring JTA Transactions JTA Transactions in the RDBMS
33
33© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? 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 Lock Table Display 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: Pre-JTA: 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: 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:
34
34© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? 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
35
35© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Active Transactions Display Usr Name Login Time Tx start Tx Id Tx State 5 dwalz 178 Active JTA - - 183 Idle JTA n Active JTA n Idle JTA n Prepared JTA n Rollback Only JTA
36
36© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Resolve JTA Transactions 1.Commit a JTA Transaction 2.Rollback a JTA Transaction 3.Quit
37
37© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? In Summary n JTA Overview n Database Changes –New transaction type –Crash Recovery Changes –Lock Manager Changes n Planning for JTA n Monitoring Enhancements JTA Transactions in the RDBMS
38
38© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Questions?
39
39© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There? Thank you for your time!
40
40© 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.