• 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

is a method in a class part of a transaction?

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also ensure that you are obtained the JDBC connection from the DataSource...
reply
    Bookmark Topic Watch Topic
  • New Topic