The only valid transaction settings for an MDB are requires and
not supported. Change requires new to requires and see what happens.
I'm surprised this is not picked up by the bean validator.

Rgds,

Dan.

-- 
Danny Yates
 


-----Original Message-----
From: Magesh Prabhu [mailto:[EMAIL PROTECTED] 
Sent: 04 July 2003 11:12
To: jboss-user
Subject: [JBoss-user] [JBoss-user]Container Transacted MDB ?


Guys,

I want my Message Driven Bean under Transaction boundaries. Transaction
should start when onMessage() call is received. Here's my deployment
descriptor which says my MDB is ContainerTransacted and It requires a New
Transaction.

    <message-driven >
      <description><![CDATA[This is reponsible for prioritising requests and
dispatching them accordingly.]]></description>
      <ejb-name>QueueDispatcherMDBBean</ejb-name>
 
<ejb-class>com.pindartech.imageprocessing.manager.queuemanager.QueueDispatch
erBean</ejb-class>
      <message-selector></message-selector>
      <transaction-type>Container</transaction-type>
      <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
      <message-driven-destination>
         <destination-type>javax.jms.Queue</destination-type>
      </message-driven-destination>
    </message-driven>

    <container-transaction>
       <method>
          <ejb-name>QueueDispatcherMDBBean</ejb-name>
          <method-name>*</method-name>
       </method>
       <trans-attribute>RequiresNew</trans-attribute>
    </container-transaction>

This MDB calls an helper class which inturn calls a bunch of Entity Beans
and updates the database. In Exceptional scenario when I want to rollback
the whole Transaction, I use this.context.setRollbackOnly();

public void onMessage(javax.jms.Message message) {

  try {

      ... do the business

  } catch(Exception e) {

     this.context.setRollbackOnly();

  }

}

When Exception occours, I get a message saying setRollbackOnly() must be
called only from a Transacted Bean. Why does the container think that my MDB
is not Container Transacted.
Please advice me If I'm missing out on anything.

[ERROR] -  [LogInterceptor].handleException() RuntimeException:
java.lang.IllegalStateException: setRollbackOnly must only be called in the
context of a transaction (EJB 2.0 - 15.5.1)
        at
org.jboss.ejb.MessageDrivenEnterpriseContext$MessageDrivenContextImpl.setRol
lbackOnly(MessageDrivenEnterpriseContext.java:214)
        at
com.pindartech.imageprocessing.manager.queuemanager.QueueDispatcherBean.onMe
ssage(QueueDispatcherBean.java:139)
        .......

Thanks in advance,
Magesh



**********************************************************************
This email and its attachments are intended for the above 
named only and may be confidential.  If they have come to 
you in error, you must take no action based on them, nor 
must you copy or show them to anyone; please reply to this 
email and highlight the error.
Security Warning: Please note that this email has been 
created in the knowledge that the internet email is not a 
100% secure communications medium.  We advise that you 
understand and observe this lack of security when emailing us.
Viruses:  Although we have taken steps to ensure that this 
email and attachments are free from any virus, we advise 
that in keeping with good computing practice the recipient 
should ensure they are actually virus free.
If you have received this email in error please notify:
[EMAIL PROTECTED]
**********************************************************************



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


_____________________________________________________________________ 
Notice to recipient: 
The information in this internet e-mail and any attachments is confidential
and may be privileged. It is intended solely for the addressee. If you are
not the intended addressee please notify the sender immediately by
telephone. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. 

When addressed to external clients any opinions or advice contained in this
internet e-mail are subject to the terms and conditions expressed in any
applicable governing terms of business or client engagement letter issued by
the pertinent Bank of America group entity. 

If this email originates from the U.K. please note that Bank of America,
N.A., London Branch, Banc of America Securities Limited and Banc of America
Futures Incorporated are regulated by the Financial Services Authority.
_____________________________________________________________________ 




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to