geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ueberbach, Michael" <michael.ueberb...@dbh.de>
Subject AW: container-transaction attributes per method
Date Mon, 07 Aug 2006 07:30:15 GMT
Hello Milan,

as far as I can see there seem's to be an misunderstandig of the transaction attribute "Required".
Setting this attribute means that there has to be an open transaction already, otherwhile
the container will throw this exception. If "Required" ist set the caller of the method is
responsible for the existence of the "required" transaction.
As I experienced there is a special point when using cmr: If you want to call a method that
looks for an entity with relations to other entities, you are forced to set the "Required"
attribute, even if you only want to read the data without changing them.

regards
Michael

-----Urspr√ľngliche Nachricht-----
Von: Unger, Milan [mailto:Milan.Unger@siemens.com]
Gesendet: Samstag, 5. August 2006 12:36
An: user@geronimo.apache.org
Betreff: container-transaction attributes per method


Hallo, 

I have problem to define transaction attributes per session bean methods in geronimo 1.1.


I set the transaction attributes (Style 1) for all methods to "Supports" and then set Style
2 attributes for some methods to "Required" (see below). Anyway, when calling that methods,
there is no transaction associated with the method call, so I get "CMR field Set must be used
in same transaction ... " exception -- the called CMP entity bean has "Required" transaction
attributes.

Do you know a reason what is wrong?

Regards, Milan. 


<container-transaction>
            <method>
                <ejb-name>ProductFacadeBean</ejb-name>
                <method-name>storeProduct</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>
        <container-transaction>
            <method>
                <ejb-name>ProductFacadeBean</ejb-name>
                <method-name>storeLink</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>
        <container-transaction>
            <method>
                <ejb-name>ProductFacadeBean</ejb-name>
                <method-name>storeLinkWithProduct</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>
        <container-transaction>
            <method>
                <ejb-name>ProductFacadeBean</ejb-name>
                <method-name>*</method-name>
            </method>
            <trans-attribute>Supports</trans-attribute>
        </container-transaction>

Mime
View raw message