felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: Managing transactions in iPOJO or OSGi component
Date Thu, 26 May 2016 09:08:54 GMT
There are two Aries modules that support managed transactions:

Aries transaction:
http://aries.apache.org/modules/transactionsproject.html
https://github.com/apache/aries/blob/trunk/transaction/transaction-testbundle/src/main/java/org/apache/aries/transaction/test/impl/SupportsTestBeanImpl.java

It allows defining transactions using the JTA 1.2 @Transactional
annotation. This only works in blueprint and supports JTA transactions. You
can define cascades of transactions to implement your local / global
semantics.


Aries tx control
http://aries.apache.org/modules/transactioncontrol.html
This is a new spec that also covers declarative services and other
dependency injection frameworks. Transactions are defined using closures.
Again you have similar semantics for cascades.

and there is

Felix Coordinator service
https://github.com/apache/felix/tree/trunk/coordinator
Implements light weight coordinations that have some of the semantics of
transactions.

Christian

2016-05-26 10:07 GMT+02:00 Balázs Zsoldos <balazs.zsoldos@everit.biz>:

> Hi,
>
> are we talking about transactions here that can be commited and rolled
> back? If there is an exception in T2 and it must roll-back, should the
> global transaction roll-back? If the global transaction rolls back, T1
> should rollback, too?
>
> If T1 should roll back, too, why do you need "local" transactions and not
> just use one atomic transaction for the whole process?
>
> If T1 should not roll back, why don't you use two separate transactions and
> that is it? What is the meaning of the "global" transaction then? I guess
> "global" transaction is a business transaction for you that counts each
> call coming through it. If that is the case, BusinessTransactionProfiler
> class, that has a function: execute(MyFunctionalInterface job); You can
> call than this function with a lambda expression and the
> BusinessTransactionProfiler should count the calls... Or something similar.
>
> Kind regards,
>
> *Balázs **Zsoldos*
>
>
>
> On Thu, May 26, 2016 at 9:01 AM, tho huynh ngoc <ngocthobkdn@gmail.com>
> wrote:
>
> > Hi,
> >
> > For me, i define transaction as follows
> >
> > a local transaction is a set of continuous actions on a component.
> > a global transaction is a set of local transactions through components.
> >
> > For example before sending a message to receiver (e.g. component B),
> client
> > (e.g. component A) needs to send the message to a compression component
> > (e.g. component C) for compressing. To do that, A initiates a local
> > transaction (T1) that consists of actions as sending msg to C, receiving
> > the compressed message, and then sending it to B.
> >
> > On the C, when receiving the message, it initiates its own local
> > transaction (T2) that consists of actions such as compressing the message
> > and returing the compressed message.
> >
> > A global transaction in this example consists of T1 and T2.
> >
> > I want to implement a manager component to know how many T2 have been
> > finished and when a transaction T2 is initiated or finished, etc.
> >
> > In fact, i want to find a solution for OSGi, iPOJO component model like
> > http://jotm.objectweb.org/jironde.html (for Fractal component model).
> >
> > Thank you for your help.
> >
> > HNT,
> >
> >
> >
> >
> >
> >
> >
> >
> > 2016-05-25 23:46 GMT+02:00 <ecki@zusammenkunft.net>:
> >
> > > Hello,
> > >
> > > If this is oracle speach then "local transaction" means a JDBC
> connection
> > > with a explicite .commit(), a "global transaction" will use XA
> > transactions
> > > (commit via Resource) and a managed transaction is a context where you
> > have
> > > a container beeing responsible for preparing and committing (can be
> local
> > > or global).
> > >
> > > Bernd
> > >
> > > --
> > > http://bernd.eckenfels.net
> > >
> > > -----Original Message-----
> > > From: David Jencks <david_jencks@yahoo.com.INVALID>
> > > To: users@felix.apache.org
> > > Sent: Mi., 25 Mai 2016 23:40
> > > Subject: Re: Managing transactions in iPOJO or OSGi component
> > >
> > > I don’t understand what you mean by “transaction”, “local transaction”,
> > > “global transaction” or “manage transactions”.  Does your usage of
> these
> > > terms have any relationship with other established uses of (some of)
> them
> > > such as the XA transaction spec?  What properties do you want these
> > > transactions to have?
> > >
> > > thanks
> > > david jencks
> > >
> > > > On May 25, 2016, at 1:23 PM, tho huynh ngoc <ngocthobkdn@gmail.com>
> > > wrote:
> > > >
> > > > 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 <ngocthobkdn@gmail.com>:
> > > >
> > > >> i'm sorry i have not finished my message in this mail
> > > >>
> > > >> 2016-05-25 21:09 GMT+02:00 tho huynh ngoc <ngocthobkdn@gmail.com>:
> > > >>
> > > >>> 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;
 }
> > > >>> }
> > > >>>
> > > >>
> > > >>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
> >
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message