• Post Reply Bookmark Topic Watch Topic
  • New Topic

Transaction

 
Rajib Sarma
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • 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
 
Karl Laird
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • 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.
 
Ram Kondawar
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks for the reply.
- Rajib
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!