• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Transaction

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have used 4 EJBs in my project. One session EJB and 3 Entity EJBs. The client invokes methods on the session EJB and the session EJB, in turn invokes the methods of the entity EJBs. I have set the transaction attributes as shown below -
For Session EJB - RequiresNew
For all entity EJBs - Requires
Is it OK?
Thanks
- Rajib
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether it is OK really depends on what you want to be occuring ;-)
However you should not encounter too many problems with those settings.
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI
The setting of requires on entity beans and requiresnew on session bean means the following.
When you invoke a method on session bean a new transaction is started. Since within this method you are invoking methods on entity beans , the transaction context is propogated to the entity bean method(because of requires setting).
If your requirement is met by the condition that the methods in session bean and entity bean to be in same transaction context then your settings are ok.
Hope this helps
Cheers
Ram
 
Rajib Sarma
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.
- Rajib
 
Skool. Stay in. Smartness. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic