Thanx Bruce.. I could get the transaction manager this way.

But I could manage to control the transaction with multipe endpoints
with it.

Is this because this is the transaction manager in the component
context?? Does JBI support transaction rollbacks with endpoints??


Regards,
Rabi Mishra,
-----Original Message-----
From: Bruce Snyder [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 08, 2008 5:09 PM
To: [email protected]
Subject: Re: Transaction in a Bean SU

On Tue, Apr 8, 2008 at 1:24 PM,  <[EMAIL PROTECTED]> wrote:
>
>  Hi All,
>
>  I want to control transaction in a servicemix-bean SU. I am trying to

> talk to multiple endpoints from a bean. The problem is when I get a
> DONE  from one of the endpoints without an error, transaction with
> that  endpoint is committed by default..
>
>  But I want to club multiple endpoint interactions in a transaction.
> Is  this possible?? If yes, how can I get the transaction manager??
>
>  I can not use the following line of code as mentioned @
> http://servicemix.apache.org/transactions.html
>
>  TransactionManager tm = (TransactionManager)
> getContext().getTransactionManager();
>
>  Any ideas..how to get the component context in a bean-su. Am I
> missing  something????

You need to add the following to your bean:

1) a property to hold the context reference
2) getContext()/setContext() methods to get/set the property

Upon adding these items, the BeanEndpoint will automatically inject the
component context using the setter. Then your call to getContext() will
succeed and you will be able to grab the transaction manager.

Bruce
--
perl -e 'print
unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/ Apache ServiceMix -
http://servicemix.org/ Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.

www.wipro.com

Reply via email to