Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB and JDBC/Distributed Transactions

 
Cory Wilkerson
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
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.
Thanks,
Cory Wilkerson
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic