Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is a method in a class part of a transaction?

 
Thambi Rajah
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following problem to be solved. Your response is appreciated.

There are two beans, BeanA and BeanB, and a class ClassC. The BeanA has a method fooA(), and BeanB has a method fooB().
In Deployment Descriptor, the methods fooA and fooB are declared required. The Client calls the method fooA() which in turn calls the method
fooB(). The method fooB() calls a method execute() in ClassC, which is not a bean. The execute() method does an update on a DataBase.
My question is whether the execute() method is part of the transaction that BeanA starts with?
Thanks in advance.
Thambi
 
Viktor Sadovnikov
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, everything in ClassC#execute() is part of transaction of BeanB, which in its turn (according to your DD) is the same transaction as BeanA. But make sure you do not start separated threads in any of your classes
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also ensure that you are obtained the JDBC connection from the DataSource...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic