• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

entity ejb cmt and datasource question.

 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I use Entity bean CMP+CMT, is it a must that the datasource that i employ has to be XA Aware? I ran into this statement somwhere and am not sure why my DS has to be XA Aware if I dont have distributed Txns in the system. Can somebody confirm?
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Karthik,
Yes it does. The reason is that very often multiple EJBs are enlisted in the same transaction. If your DataSource is non-TX then this is going to work if and only if all participants will share the same phisical databse connection. This basically means that you have to programm your EJBs accordingly and to pass the same database connection from one bean to another. As with most of the EJBs one usually gets a new connection from the pool for every method call. In theory at least, using CMT should also imply that (for optimization reasons) the container will reuse the same connection throughout the entire transaction. In practice though it�s probably not going to work. However WebLogic will allow you setting TX-DataSources pretty easily, just enabling the Honor Global Transactions when defining the DataSource. There are several reasons that might enforce your app to use non-TX drivers (when the underlying database doesn�t support distributed transactions, for example), but this should not be the case for any EJB applications.
Regards.
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Valentin!

Originally posted by Valentin Tanase:

If your DataSource is non-TX then this is going to work if and only if all participants will share the same phisical databse connection.


I assume you meant 'non XA Aware' and not 'non - TX'. Is that correct?


This basically means that you have to programm your EJBs accordingly and to pass the same database connection from one bean to another.


So an XA Aware DS makes sure that the same connection is passed on to each of the EJBs enlisted in a single transaction? or it does somethin totally different that doesnt require the use of a single connection object across the single transaction?.

 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Karthik,


I assume you meant 'non XA Aware' and not 'non - TX'. Is that correct?


That�s correct.


So an XA Aware DS makes sure that the same connection is passed on to each of the EJBs enlisted in a single transaction? or it does somethin totally different that doesnt require the use of a single connection object across the single transaction?.


It basically allows multiple connections to be enlisted in the same transaction.
Regards.
 
reply
    Bookmark Topic Watch Topic
  • New Topic