Transactions support using Declarative services

133 views
Skip to first unread message

Deepak Tyagi

unread,
Jan 16, 2017, 5:56:45 PM1/16/17
to bndtools-users
Hello All,

We are using OSGi DS using bndtools for our webservices backend platform. It is an application which has close to 250 APIs that support 5 application clients including desktop web UI, mobile app, partner applications. For the tech stack we are using :-

a) OSGi DS
b) Apache Felix
c) BndTools
d) Apache Karaf
e) myBatis
f) Oracle Database
g) Jersey for REST
h) Karaf features for deployment


We are using myBatis with Oracle and have Apache Karaf as our stack. We haven't had transactions support in the application yet but now we are planning to incorporate them and I would really appreciate if the group can direct me in the right direction. I have been researching about this and got mixed results. Some sources say that transactions are not easy with DS, so blueprint should be the way to go. Others point at Apache Aries. Is there best practice way to do transactions with Apache Karaf, DS?

Thanks
Deepak


David Jencks

unread,
Jan 16, 2017, 6:30:56 PM1/16/17
to bndtool...@googlegroups.com
DS concerns setting up and tearing down components, and has nothing to do with transactions or any other concern of runtime threads.  Blueprint “supports” transactional stuff by wrapping your component in a proxy.  This causes lots more problems than it solves IMO.

I would look into the aries tx-control project.  IIUC it’s not released yet since it’s the RI for an unreleased OSGI spec, but it’s the best OSGI transaction support I know of.  I think it currently  supports  JPA (eclipse link, openJPA, and hibernate) so you might need to  add myBatis support.

hope this helps
david jencks

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christian Schneider

unread,
Jan 17, 2017, 1:16:29 AM1/17/17
to bndtool...@googlegroups.com
The only problem with DS is that it can not use interceptors to do annotation based transaction support. Apart from that it works very well.
There are two ways to use transactions with DS.

2. tx-control, which also uses a part of aries jpa

In both cases the approach is that you put your transactional code into a closure and let the framework handle the jpa and transaction management.

Christian

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Timothy Ward

unread,
Jan 17, 2017, 4:00:10 AM1/17/17
to bndtool...@googlegroups.com
Hi Deepak,

As mentioned in previous mails from David and Christian, the OSGi Transaction Control Service (with an implementation in Aries) supports both managed transactions (both XA and local) in an easily consumable way. You can use Transaction Control in DS components, blueprint beans, or any other component model.

There are already transaction control resource providers implemented for JDBC and JPA. As Christian mentions, the Aries Transaction Control JPA support makes use of the OSGi JPA Service, of which Aries JPA is an implementation. If you’re not using JPA then there is no need to include a JPA Service implementation.

To answer your question about myBatis, no resource provider exists for it, but it should be relatively simple to add one to the Aries Transaction Control project. Transaction Control is designed to be modular and extensible, so this would be “just another provider” to add to the project. Aries tx-control already has a “common” project which provides much of the infrastructure for implementing a resource provider, it would just be a case of defining a myBatis provider factory service interface and defining the scope delegating handlers.

I hope this helps with your research.

Regards,

Tim


To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
Message has been deleted

Deepak Tyagi

unread,
Jan 17, 2017, 10:59:25 AM1/17/17
to bndtools-users
Thanks everyone for quick responses. Let me go through them and will get back to the group with more info.

Deepak Tyagi

unread,
Feb 22, 2017, 12:35:34 AM2/22/17
to bndtools-users
Hi Tim,

I am trying to find the aries transaction control project source but I am unable to find it. Would you please point me where should i look for it.

Thanks,
Deepak

Christian Schneider

unread,
Feb 22, 2017, 2:23:32 AM2/22/17
to bndtool...@googlegroups.com
You can find the sources here:

Christian

--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim Ward

unread,
Feb 22, 2017, 3:14:55 AM2/22/17
to bndtool...@googlegroups.com
The artifacts are also released to Maven Central.


Tim

Sent from my iPhone
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.

Deepak Tyagi

unread,
Feb 22, 2017, 1:33:50 PM2/22/17
to bndtools-users
Awesome! 

Thanks.

Deepak
Reply all
Reply to author
Forward
0 new messages