Hi,

I define a transaction is a set of continuous activities (one method or set
of methods) in a component.

I wrote a simple example as follows:

//service interfacepublic interface Hello {
    String sayHello(String name);
    String sayBonjour(String name);}
//service implementation @Componentpublic class HelloImpl implements Hello {

    public String sayHello(String name) {
       //start local transaction
       return "hello " + name;
       //finish local transaction
    }
    public String sayBonjour(String name) {
       //start local transaction
       return "bonjour " + name;
       //finish local transaction
    }}
//client@Componentpublic class Client {

   Hello client;
   public Client() {
      //start local transaction
      client.sayHello("world");
      client.sayBonjour("le monde");
      //finish local transaction
   }
  }

In this example, there are local transactions in the components HelloImpl
and Client. I define that global transaction of the system consists of a
set of local transactions through all components.

How to manage transactions (global transaction and the local transtions in
this example) in OSGi or iPOJO ?

Thank you for your response

Regards,


2016-05-25 21:12 GMT+02:00 tho huynh ngoc <[email protected]>:

> i'm sorry i have not finished my message in this mail
>
> 2016-05-25 21:09 GMT+02:00 tho huynh ngoc <[email protected]>:
>
>> Hi,
>>
>> I define a transaction is a set of continuous activities (one method or
>> set of methods) in a component.
>>
>> I wrote a simple example as follows:
>>
>> //service interface
>> public interface Hello {
>>     String sayHello(String name);
>> }
>>
>> //implementation service
>> @Component
>> public class HelloImpl implements Hello {   public HelloImpl() {
>>         System.out.print("start Hello implementation");
>>     }
>>
>>     public String sayHello(String name) { return "hello " + name;  }
>> }
>>
>
>

Reply via email to