File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes EJB and JDBC/Distributed Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB and JDBC/Distributed Transactions" Watch "EJB and JDBC/Distributed Transactions" New topic

EJB and JDBC/Distributed Transactions

Cory Wilkerson
Ranch Hand

Joined: Aug 14, 2001
Posts: 84
I'm attempting to get my head around something here and I can't make 2 and 2 == 4. My question is this:
I've currently stepped into a pretty hefty EJB-based architecture where all EJBs (BMP) have the trans-attribute set to Required. Does this implicity imply that Connection objects used by any given business method in any given entity bean must be generated from a DataSource that supports distributed transactions?
I understand that it means that the business method itself will execute in a transactional context, but, must the JDBC resources being used also support distributed functionality.
Cory Wilkerson
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
The answer is yes, probably. Most Transaction Servers do support the idea of both global and local transactions, but the support for local transactions is usually vendor-specific and somewhat limited. If you choose to use a 2PC enabled datasource the container can usually figure out on its own if it can optimize for 1PC if that's all that's needed.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
I agree. Here's the link:
subject: EJB and JDBC/Distributed Transactions
It's not a secret anymore!