• Post Reply Bookmark Topic Watch Topic
  • New Topic

Default transaction attribute

 
Ashutosh Shinde
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
What is the default transaction attribute set for methods of the Session/Entity bean when the transaction attribute is not explicitly mentioned in the XML file?
Thanks,
Ashutosh
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no default transaction setting dictated by the EJB Specification:
EJB 2.0 Specification, Section 17.5
The Deployer is responsible for ensuring that the methods of the deployed enterprise beans with container-managed transaction demarcation have been assigned a transaction attribute. If the transaction attributes have not been assigned previously by the Assembler, they must be assigned by the Deployer.

If you do not specify a transaction attribute for methods in an EJB then it's transactional behavior will depend on the particular EJB Container that you are using.
In the case of WebLogic, if a transaction attribute is not specified then the EJB or method behaves as if it has a transactional setting of "Supports". JBoss, on the other hand, seems to default to "Required".
For the sake of portability, you should always specify a transaction setting for your EJBs.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!