• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

SessionSynchronization

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible that a session bean defines and uses a transaction enable method, but the bean NOT implementing the SessionSynchronization interface?
 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes it is possible. Only if you need notifications associated with the transaction then u need to implement that interface.
Also make sure that when you implement the sessionsynchronization interface the methods must not be in unspecified transaction context i.e. only Required, RequiresNew and Mandatory transaction attributes must be used.
 
Ali Ragi
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you!

... Also make sure that when you implement the sessionsynchronization interface the methods must not be in unspecified transaction context i.e. only Required, RequiresNew and Mandatory transaction attributes must be used.


So if I don't implement the sessionsynchronization, I don't have to follow that rule, and I can be in unspecified transaction context? or still have to follow the same rule?
[ February 29, 2004: Message edited by: Ali Ragi ]
 
Sudhir V
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJB Spec Pg 351 says that:
"For a session bean, the transaction attributes must be specified for the methods defined in the bean�s component interface and all the direct and indirect superinterfaces of the component interface, excluding the methods of the javax.ejb.EJBObject or javax.ejb.EJBLocalObject interface. Transaction attributes must not be specified for the methods of a session bean�s home interface."
So you have to specify some transaction attribute but when using SessionSynchronization it must be either "Required", "RequiresNew", "Mandatory". See spec pg 352 5th Paragraph.
 
reply
    Bookmark Topic Watch Topic
  • New Topic