-
1. Re: messagebean can't call setRollbackOnly 2.4.0BETA
pra Aug 22, 2001 3:30 AM (in response to panz)If I remember correct, the example from the manual is about a MDB with container managed TX:
The type of error you get should only ever happen with bean managed TX MDB (getAcknowledgeMode() != MessageDrivenMetaData.CLIENT_ACKNOWLEDGE_MODE)
No, CLIENT_ACKNOWLEDGE_MODE, is not something you may set in the dep descriptor, it is used internaly in the container.
Är you using bean managed TX?
//Peter -
2. Re: messagebean can't call setRollbackOnly 2.4.0BETA
panz Aug 22, 2001 1:53 PM (in response to panz)No, i'm not (intentionally :) using BMT.
The bean deploys properly on weblogic using CMT. (But who wants to use weblogic?)
My ejb-jar looks like this:
<message-driven>
<display-name>TestModule</display-name>
<ejb-name>TestModule</ejb-name>
<ejb-class>...TestModule</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
...
</message-driven>
...
<assembly-descriptor>
<container-transaction>
<ejb-name>TestModule</ejb-name>
<method-name>*</method-name>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
jboss.xml looks like:
<message-driven>
<ejb-name>TestModule</ejb-name>
<configuration-name>Standard Message Driven Bean</configuration-name>
<destination-jndi-name>queue/testModuleQueue</destination-jndi-name>
</message-driven> -
3. Re: messagebean can't call setRollbackOnly 2.4.0BETA
pra Aug 23, 2001 6:00 AM (in response to panz)Hi, OK should I say congrats or I am sorry? You have actually discovered a bug in the MDB container.
This has been fixed in the main branch, but when it will find it's way into 2.4.0 I do not know.
(The only fix for now is not to use setRollbackOnly, but to throw an EJBException - which will do exactly the same thing).
I am sorry to have caused this, because it is my fault.
//Peter -
4. Re: messagebean can't call setRollbackOnly 2.4.0BETA
panz Aug 23, 2001 5:34 PM (in response to panz)Ok. I guess that's a dubious honor.
Is the fix complex, or is there a straightforward issue that a rookie such as myself may be able to address?
Is there a workaround, or is it just not possible to transactionally send messages from an MDB at this point? -
5. Re: messagebean can't call setRollbackOnly 2.4.0BETA
pra Aug 24, 2001 3:11 AM (in response to panz)It's pretty easy to fix (browse the CVS and make diffs and you get the picture.
It should however work under the following conditions:
- A bean wich inherits the transaction is called, it rolles back the transaction. The transaction in the MDB will the also be rolled back (it does not have to set RollbackOnly.
- The MDB throws an EJBException in onMessage: this will also rollback the message receipt.
Or is this not the behaviour you where looking for?
Remember however, if you constantly rollback the receipt of a message, JBoss will start running in a tight loop, since it will try to send the message on and on.
Basically, if you think you will never have success in receiving the message, you SHOULD receive it, otherwise bad things will happen since JBossMQ does not have a Dead Letter Queue.
//Peter -
6. Re: messagebean can't call setRollbackOnly 2.4.0BETA
pra Aug 24, 2001 6:22 AM (in response to panz)Hi,
I have now merged the chanes into the 2.4.x tree. Either wait for the 2.4.1 relese or check out the 2.4 version (see cvs instructions on how to do that).
A nice feature with the latest 2.4.x is that JBossMQ 1.0 beta is now backported - and this is the fastes, most stable and feature rich version of JBossMQ, EVER.
//Peter