jpa - EJB Session beans/methods transaction attributes -
i became in charge ejb 3.1/jpa part of our project running on glassfish 4.0. quite new ejb , not confident in session beans(and/or methods) transaction attributes. dealing stateless session beans. read not_supported, never, supports transaction attributes should used caution because behavior varies app server vendor. actually, not find statements in other sources. vendor specific? also, correct not annotating method or bean defaults required transaction attribute it?
and here situation. let's have transaction t , 2 stateless beans , b methods ma , mb. ma calls mb. possible combinations transaction attributes of these methods transaction t go successfully? know if ma has required , mb has never exception throw. supports on mb kind incoming transaction - safe option make sure transaction go through method without error? thank you
glassfish 4.0 reference implementation of java ee 7 , according release notes supports enterprise javabeans 3.2 (jsr-345).
i read not_supported, never, supports transaction attributes should used caution because behavior varies app server vendor. not find alerts in other sources rather 1 mentioned. please advice me if should concerned that.
basically ejb specification says implement not how implement there still may rare corner cases since not living in perfect world. suppose why have been alerted. other hand wouldn't concern glassfish used across world , surely conforms jsr specification.
also, correct not annotating method or bean defaults required transaction attribute?
yes, correct. according ejb 3.2 specification, chapter 8.3.7 specification of transaction attributes bean’s methods:
by default, value of transaction attribute method of bean container-managed transaction demarcation required transaction attribute, , transaction attribute not need explicitly specified in case.
can please advice me source can find correct or in incorrect combinations of transaction attributes on different methods of different ejbs in 1 call stack 1 given transaction.
the ultimate source of knowledge mentioned ejb specification (chapter 8.6 more specific) find lot of useful posts around. in general take closer @ transaction propagation , transaction demarcation related topics.
will supports attribute adapt method/bean calling method/bean whatever transaction attribute, no error occur?
not really. supports propagates transaction context (if any) of calling method/bean, may safely query data within should avoid operations change persistence context.
Comments
Post a Comment