• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic