• 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

"default" CMT behavior if trans attributes not specified

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The <assembly-descriptor> section of an EJB-JAR is optional. I haven't been able to find an explicit statement anywhere on what happens if the Bean Provider specifies
<transaction-type>Container</transaction-type>
indicating CMT for this bean, however, no <trans-attribute>s are specified because the <assembly-descriptor> section has been omitted.
In other words, what is the "default" CMT behavior (typically described by transaction attributes) if no transaction attributes are specified?
Thanks
 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Chris:
Section 17.4.1 of the spec says

Providing the transaction attributes for an enterprise bean is an optional requirement for the Application Assembler, because, for a given enterprise bean, the Application Assembler must either specify a value
of the transaction attribute for all the methods for which a transaction attribute must be specified, or the Assembler must specify none. If the transaction attributes are not specified for the methods of an enterprise
bean, the Deployer will have to specify them.


You were correct in saying that the <application-descriptor> is optional, but the transaction attributes are not. If the application assembler does not specify them, then the Deployer must. The spec does not indicate a particular default behavior if a transacion attribute is not specified. I suppose it is vendor specific, but this should never happen, because the spec does not allow it.

Hope this helps,
 
Chris Raiskin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I'll be more specific .. Here is the DD for a functional SFSB deployed on IBM WAS 5.0.2. The transaction type is "Container". The <assembly-descriptor> section is empty and there are no <trans-attribute> elements. What is the "default" behavior of the SFSB with CMT as typically described by transaction attributes?
Thanks

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar id="ejb-jar_ID">
<display-name>Counter EJB-JAR</display-name>
<enterprise-beans>
<session id="Session_1">
<description>stateful test ejb</description>
<display-name>Counter</display-name>
<ejb-name>Counter</ejb-name>
<local-home>com.ejb.counter.CounterLocalHome</local-home>
<local>com.ejb.counter.CounterLocal</local>
<ejb-class>com.ejb.counter.CounterBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor id="AssemblyDescriptor_1">
</assembly-descriptor>
</ejb-jar>
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Chris:
If you are preparing for the cert then you only need to know what is in the spec. The spec doesn't indicate what would happen in this situation. I suppose the way this situation would be handled is vendor specific. If you still *need* to know the answer, I would suggest referring to the WAS documentation.

Hope this helps.
 
Chris Raiskin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Keith.
I was hoping someone on this forum might have an answer to that...
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By Default, transaction attribute for a method of a bean in the container-managed transaction demarcation is the REQUIRED attribute and the transaction attribute does not need to be explicitly specified.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic