db-16 : jta transactions in the rdbms, what's going on down there?
DESCRIPTION
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. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/1.jpg)
DB-16: JTA Transactions in the RDBMS, What's Going on Down There?Deb WalzPrincipal Software Engineer
![Page 2: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/2.jpg)
2 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
JTA Transactions in the RDBMS
JTA Overview Changes to database engine Planning for JTA support Monitoring JTA Transactions
![Page 3: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/3.jpg)
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
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.
D I S C L A I M E R
![Page 4: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/4.jpg)
4 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
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
![Page 5: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/5.jpg)
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
JMS
JAA
SJA
XPJD
BC
Applet Container
J2SE
Applet Web Container
J2SE
JMS
JAA
S
JAXP
JTA
Connector
JDB
C
Java Mail
JAF
JSP Servlet
HTTP SSL
HTTP SSL EJB Container
J2SE
EJB
JMS
JAA
S
JAXP
JTA
Connector
JDB
C
Java Mail
JAF
Database
![Page 6: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/6.jpg)
6 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
JTA Architecture
JTA UserTransaction
ApplicationServer
Application ResourceManager
TransactionManager
EJB
JTA XAResource
JTA TransactionManager
JDBC, JMS
![Page 7: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/7.jpg)
7 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Prepare Phase
Two-Phase Commit Protocol
Transaction Manager Oracle
OpenEdge
OpenEdgePrepare to Commit
Ready to Commit
Resolution Phase
Transaction Manager Oracle
OpenEdge
OpenEdgeCommit
Complete
![Page 8: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/8.jpg)
8 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
JTA XAResource Methods
start (xid, …) end (xid, …) prepare (xid) commit (xid, …) rollback (xid) recover(…)
![Page 9: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/9.jpg)
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);
![Page 10: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/10.jpg)
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);
![Page 11: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/11.jpg)
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
![Page 12: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/12.jpg)
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);
![Page 13: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/13.jpg)
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?
http://java.sun.com/j2ee/index.jsp http://java.sun.com/products/jta/ http://www.datadirect.com/developer/jdbc/topics/jta/index.ssp
![Page 14: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/14.jpg)
14 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
JTA Overview Changes to database engine Planning for JTA support Monitoring JTA Transactions
JTA Transactions in the RDBMS
![Page 15: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/15.jpg)
15 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Database Changes
New type of transaction Data structure changes Crash Recovery changes Lock Manager changes
![Page 16: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/16.jpg)
16 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
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
JTA Transactions
![Page 17: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/17.jpg)
17 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
TransactionList
UserList
Data Structures – Traditional Transactions
TransactionTableEntry
Transaction IdState
User IdTime Started
Flags
![Page 18: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/18.jpg)
18 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Data Structures – JTA Transactions
Transaction IdState
User IdTime Started
Pointer to JTAFlags
JTA XIDState
Transaction IdUser IdLocks
JTA Entry
JTA (XID)List
Active
Idle
Trad’l
TransactionList
UserList
TransactionTableEntry
![Page 19: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/19.jpg)
19 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Crash Recovery Changes
New Lock Application Phase Presence of Lock Table New BI Notes Effect on database utilities
![Page 20: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/20.jpg)
20 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Crash Recovery - Review
Redo Phase Undo Phase
– Physical Undo– Logical Undo
![Page 21: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/21.jpg)
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 2005Multi-user session begin. (333)Begin Physical Redo Phase at 0 . (5326)Physical Redo Phase completed … (7161)Begin JTA Lock ApplicationEnd JTA Lock Application …
![Page 22: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/22.jpg)
22 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Thu Mar 24 18:21:22 2005Multi-user session begin. (333)Begin Physical Redo Phase … (5326)Physical Redo Phase Completed … (7161)Begin JTA Lock ApplicationEnd JTA Lock ApplicationBegin Physical Undo 2 Transactions … (7163)Physical Undo 1 Live JTA Transactions detectedPhysical 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 detectedLogical Undo Phase Completed … (12095)Logical Undo: 1 Live JTA Transactions active
New Lock Acquisition Phase – after database crash
![Page 23: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/23.jpg)
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_CXINSRL_RMCR
RL_TEND
Traditional Transaction
RL_TBGN
RL_CXINSRL_RMCR
RL_RCOMMRL_TEND
4GL 2PC Transaction
RL_GTBGNRL_XID
RL_TBLLKRL_CXINSRL_RMCRRL_GENDRL_GPREPRL_GTEND
JTA Transaction
![Page 24: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/24.jpg)
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: <xid> 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 <db> -C
2phase recover. (2042)** The server exited with error code 20. (800)
![Page 25: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/25.jpg)
25 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
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
![Page 26: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/26.jpg)
26 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Lock Manager Data Structures
JTA XIDState
Transaction IdUser IdLocks
JTA EntryJTA (XID)List
Lock Entries …
![Page 27: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/27.jpg)
27 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
JTA Overview Changes to database engine Planning for JTA support Monitoring JTA Transactions
JTA Transactions in the RDBMS
![Page 28: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/28.jpg)
28 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Planning for JTA Support
Enabling JTA Support Space allocation Startup Parameters
![Page 29: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/29.jpg)
29 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Enabling JTA Support
proutil <dbname> –C enablejta – Disables after-imaging (if enabled)
proutil <dbname> -C disablejta
![Page 30: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/30.jpg)
30 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Space Allocation
More notes implies more BI and AI space needed
![Page 31: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/31.jpg)
31 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Startup Parameters
-maxxids -L -bithreshold Standard performance tuning
– -bibufs– -B
![Page 32: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/32.jpg)
32 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
JTA Overview Changes to database engine Planning for JTA support Monitoring JTA Transactions
JTA Transactions in the RDBMS
![Page 33: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/33.jpg)
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:
![Page 34: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/34.jpg)
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
![Page 35: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/35.jpg)
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 <T1> <T2> 178 Active JTA - - <T3> <T4> 183 Idle JTA
Active JTA Idle JTA Prepared JTA Rollback Only JTA
![Page 36: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/36.jpg)
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 Transaction2. Rollback a JTA Transaction3. Quit
![Page 37: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/37.jpg)
37 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
In Summary
JTA Overview Database Changes
– New transaction type– Crash Recovery Changes– Lock Manager Changes
Planning for JTA Monitoring Enhancements
JTA Transactions in the RDBMS
![Page 38: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/38.jpg)
38 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Questions?
![Page 39: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/39.jpg)
39 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?
Thank you for your time!
![Page 40: DB-16 : JTA Transactions in the RDBMS, What's Going on Down There?](https://reader035.vdocuments.mx/reader035/viewer/2022062411/56815994550346895dc6daa7/html5/thumbnails/40.jpg)
40 © 2005 Progress Software Corporation DB-16 JTA Transactions in the RDBMS, What's going on Down There?