Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes [ejb 2 session]  default transaction attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "[ejb 2 session]  default transaction attribute" Watch "[ejb 2 session]  default transaction attribute" New topic
Author

[ejb 2 session] default transaction attribute

Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2049
Hello,

For the code below, in relation to a session bean named theEjb, from ejb-jar.xml,

1) Is container-transaction tag, or its corresponding bmt tag, required? Or is there a default? E.g. if I dont declare any container-transaction tag like below, all methods of 'theEjb' will have the default transaction attributes (e.g. whatever is the default, e.g. 'Supports')?

2) If I have a method 'method2', with the definition below, specified, what will method2's transaction attribute going to be in runtime? Supports? or NotSupported ? or Never? etc.?

Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

Jesus Angeles wrote:
1) Is container-transaction tag, or its corresponding bmt tag, required? Or is there a default? E.g. if I dont declare any container-transaction tag like below, all methods of 'theEjb' will have the default transaction attributes (e.g. whatever is the default, e.g. 'Supports')?

The tag is not mandatory. If the tag is not present, then I think it means bean-managed. If it is bean-managed, the transaction attributes do not come into play at all.

Jesus Angeles wrote:
2) If I have a method 'method2', with the definition below, specified, what will method2's transaction attribute going to be in runtime? Supports? or NotSupported ? or Never? etc.?

As far as I remember, the default value was not well-defined in the specification for EJB 2 - I think it was corrected in EJB 3. So, in EJB 2, the default value differed between vendors.

You can use the '*' pattern in the method name and provide a transaction attribute for all methods at one stretch. Like:

So, you can define one for a specific method and define another attribute for the rest.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [ejb 2 session] default transaction attribute
 
Similar Threads
Issue in CMR entity bean
EJB 1.1 Migration from WebLogic 5 to WebLogic 10
weblogic 8 to 10 migration..ErrorCouldnot locate bean ejb-jar.xml with EJB1.1
Help to solve NoInitialContextException
Enthuware question doubt