-
1. Re: MDB Rollback & no transaction context
adrian.brock Jan 20, 2004 6:14 PM (in response to spetersodlb)You have assembly-descriptor?
<ejb-jar>
....
<assembly-descriptor>
<container-transaction >
<ejb-name>myMDB</ejb-name>
<method-name>onMessage</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
Regards,
Adrian -
2. Re: MDB Rollback & no transaction context
spetersodlb Jan 20, 2004 6:27 PM (in response to spetersodlb)Yup, my other container transactions are in there as well.
I should also probably add that I'm using the default server, in case that make some difference. -
3. Re: MDB Rollback & no transaction context
spetersodlb Jan 24, 2004 5:12 AM (in response to spetersodlb)After a lot of trial and error, I've discovered the answer: somewhere in all my original floundering I managed to lose the tags that must surround the <ejb-name> and <method-name> tags. So the following works:
<container-transaction >
<ejb-name>myMDB</ejb-name>
<method-name>onMessage</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
But wait, there's more!
If I use "RequiresNew" it doesn't work (I'm no expert on transactions, but it seems like it should).
Also, I am using xdoclet (1.2b3 and 1.2) to generate the assembly-descriptor entries and it generates
<method-name>*</method-name>
if I use the ejb.transaction tag at the class level. This doesn't work.
If I use the ejb.transaction tag at the method level, it generates
<method-name>onMessage</method-name>
<method-parms>
... method parm tags....
</method-parms>
which also doesn't work. (Seems like I read somewhere that this is/was a known problem). There may be some way to get xdoclet to generate what _does_ work, but I couldn't figure it out; the only way I've found so far is to use the assembly-descriptor merge point with the hand-coded xml listed above.
Sure hope this saves someone else some trouble.... -
4. Re: MDB Rollback & no transaction context
spetersodlb Jan 24, 2004 5:16 AM (in response to spetersodlb)Arrgh! Somehow my previous post got messed up. Here's what works:
<container-transaction >
<ejb-name>myMDB</ejb-name>
<method-name>onMessage</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction> -
5. Re: MDB Rollback & no transaction context
spetersodlb Jan 24, 2004 5:19 AM (in response to spetersodlb)Guys, what is with the editor for this forum???? It insists on leaving out the
... tags that are in my previous two posts! Maybe this will work. In my previous posts for what does work, insert after the <container-transaction> tag
the following: "" and before the <trans-attribute> tag insert "".
I'm crossing my fingers that this makes it in.... -
6. Re: MDB Rollback & no transaction context
spetersodlb Jan 24, 2004 5:21 AM (in response to spetersodlb)OK, I give up on providing the literal stuff you need. Here it is in English. After the <container-transaction> tag insert a "method" tag and before the <trans-attribute> tag insert a "/method" tag.