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/