Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Advanced JDBC topics for 484

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I'm preparing for the 484 exam. Where can I find information on advanced JDBC topics like XADataSource and ConnectionPoolDataSource ?
Are there any good links/tutorials ?
Thanks
Sindhu
 
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope this article will give you some introduction to the Connection Pooling and Distributed Transactions.
http://java.sun.com/products/jdbc/articles/package2.html
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Could anyone can explain to me that what is a XADataSource?
I have used JDBC, however, I never come across this term.
Many thanks.
Nick.
 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Nicholas,
In fact, you might have used this class but didn't notice it
The difference between the DataSource and XADataSource is that the latter allows you to perform distributed transactions, that is transactions across multiple resource managers (databases, JMS providers, EIS). The transaction management is controlled by the JTA transaction manager (app. server) and uses 2-phase commit protocol.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Serge,
In such sense, we do need to configure all the distributed data source? Or we need to have references for each distributed data source (since there should be no deployment descriptor for application server to define them) inside the program?
In addition, does 2-pharse commit protocol the same term of 2-pharse locking protocol?
Many many thanks.
Nick.
 
Serge Adzinets
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nicholas,
sorry, I may have not got the question
I think you don't need to do anything special configuration to use distributed transactions. What you should do is configure the connection factories in the app server and define resource references to them in the deployment descriptor for you bean.
What is special is that drivers (resource managers) participating in the such a transaction must support XA (implement classes starting with XA). Also, you should set the right classes for connection factories in the server settings. In WSAD, see Datasources, JMS and J2C pages of the test environment.
There's a good chapter about transactions in Mastering EJB by Ed Roman
 
Serge Adzinets
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I don't know what is 2-phase locking
 
Ranch Hand
Posts: 8934
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would you suggest that downlaod the JDBC 3.0 spec and read it. It is great.
 
author
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Sindhu Richard:
hi
I'm preparing for the 484 exam. Where can I find information on advanced JDBC topics like XADataSource and ConnectionPoolDataSource ?
Are there any good links/tutorials ?
Thanks
Sindhu


Hello Sindhu,
My book has (IMHO ) excellent coverage of J2EE Connector Architecture(Chapter 10 - JCA) explaining two phase commit in terms of resource managers and transaction managers, and Connection Pooling (Chapter 14 - WebSphere Administration). I believe that you will find the treatment to be quite useful. You may also want to refer to Chapter 8, which focuses exclusively on Transactions.
Regards,
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Serge and Pradeep,
I will read more on this issue.
Many thanks!
Nick.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In addition, does 2-pharse commit protocol the same term of 2-pharse locking protocol?
Many many thanks.
Nick.


Hi Nick,
2-phase locking is not the same as 2-phase commit. 2PL ensures a serializable schedule, while 2PC ensures the atomicity of global/distributed transactions.
With 2-phase locking, you have 2 distinct phases, namely, growing and shrinking phases. In the 1st phase, you can only acquire locks - no unlocks. In the 2nd phase, you can only unlock stuff - no more acquisitions. The shrinking phase starts with the first lock release. There are more complex variations but the basic idea remains the same.
Hope this helps.
Zach
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!