You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Sandeep Raman <sa...@tcs.com> on 2008/03/22 09:36:41 UTC

Transaction Handling.

Hi,

I need some guidance on how can i handle transactions in my composite 
file.

My requirement is this:

1) I Have three components , all java classes which does some 
transformation , I now form a composite of these 3 components.
2) To compose the 3 components I have written a Composer Class (Composer - 
Interface and ComposerImpl - class) which calls the components passing the 
appropriate input this way:
 
                public String Compose(String s) { 
 
                                        Main_ESB main = 
scaDomain.getService(Main_ESB.class, "EAI1Component");
                                        completnessXml = 
main.getSynchronousResponse(ingestionXml);

                                        Main_ESB main2 = 
scaDomain.getService(Main_ESB.class, "EAI2Component");
                                        queryxml = 
main.getSynchronousResponse(completnessXml );
 
                where EAI1Component and EAI2Component are the name of my 
component.

3) Now i wish to add some transaction information in the class like:
                    public String Compose(String s) { 
 
                        TransactionManager tm = 
TransactionManagerFactory.getTransactionManager();
                        tm.begin();
 
                                Main_ESB main1 = 
scaDomain.getService(Main_ESB.class, "EAI1Component");
                                        completnessXml = 
main.getSynchronousResponse(ingestionXml);

                                Main_ESB main2 = 
scaDomain.getService(Main_ESB.class, "EAI2Component");
                                        queryxml = 
main.getSynchronousResponse(completnessXml );
 
                        tm.commit();

Mentioning requires = "transaction" doesnt seem to be working. I tried to 
use "managedtransaction" which again leads to errors such as
org.apache.tuscany.sca.assembly.builder.impl.PolicyComputationException
Now how can i let know the components that a transaction is happening and 
to pass the information further to them. I went through the specs for 
transaction handling , but i guess a sample will make things clear to me. 
Also I find lot of intents in definitions.xml for transaction , and lots 
of classes under org.apache.tuscany.sca.policy.transaction.

 Which intent is the most suited here to be used and can i get some 
samples for the same.


Regards
Sandeep.
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you