• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Transaction in EJB

 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The J2EE tutorial says,
"Session beans need the attributes defined for business methods, but do not allow
them for the create methods. Entity beans require transaction attributes for the
business, create, remove, and finder methods. Message-driven beans require
transaction attributes (either Required or NotSupported) for the onMessage
method."

But I don't get any error if I don't specify any transaction attributes. Can somebody explain why? May be there is a default transaction attribute?

Thank you very much in advance.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The specs don't provide any default transaction attribute - so developers are expected to provide one. The individual vendors usually provide a default (which varies, eg Weblogic might default to Supports while another vendor might set Required)- so if you don't provide a transaction attribute yourself, your code might not be portable between containers wrt transaction.
 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For EJB3, the default transaction attribute is REQUIRED. I believe this is portable accross all vendors
 
Sumitro Palit
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for clarifying that -- good to know that EJB 3 has finally provided a default transaction attribute.

The EJB3 specs - "JSR220: Section 13.3.7 - Specification of the Transaction Attributes for a Bean�s Methods" covers this in details incase anyone wants to go into the details.
 
PradeepPillai Pradeep
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks you all.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic