Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-15 Thread Timothy Ward
Seems to be working ok now with extremely minor changes. https://github.com/sahlex/declarative-poc/pull/1 Best Regards Tim > On 15 Sep 2017, at 08:36, alexander.sah...@brodos.de wrote: > > Tim, > > please find the project here: >

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-14 Thread Timothy Ward
> On 14 Sep 2017, at 16:01, Guillaume Nodet wrote: > > > > 2017-09-14 14:17 GMT+02:00 Timothy Ward >: > Note that this work should be done as part of a new transaction control > service implementation (there’s some

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-14 Thread Guillaume Nodet
2017-09-14 14:17 GMT+02:00 Timothy Ward : > Note that this work should be done as part of a new transaction control > service implementation (there’s some common code which should help to speed > up implementing it), not as changes to the current implementation, which is >

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-14 Thread Timothy Ward
Note that this work should be done as part of a new transaction control service implementation (there’s some common code which should help to speed up implementing it), not as changes to the current implementation, which is undergoing stabilisation as the Reference Implementation of the OSGi

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-14 Thread alexander.sahler
I'll give it a try. Maybe with a little guidance of you guys. First of all I'll try to inject a JTA TransactionManager into tx-control instead of the internal one. If that is working, I'll let you know. >>> On 14 Sep 2017, at 10:46, Guillaume Nodet wrote: 2017-09-14

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-14 Thread Timothy Ward
> On 14 Sep 2017, at 10:46, Guillaume Nodet wrote: > > > > 2017-09-14 11:40 GMT+02:00 Timothy Ward >: > Hi Alexander, > > As has been discussed on the Aries lists before, I have no problem with > someone creating a

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-14 Thread Guillaume Nodet
2017-09-14 11:40 GMT+02:00 Timothy Ward : > Hi Alexander, > > As has been discussed on the Aries lists before, I have no problem with > someone creating a separate implementation of the Transaction Control > service which leverages the OSGi JTA Service Specification. The

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-14 Thread Timothy Ward
Hi Alexander, As has been discussed on the Aries lists before, I have no problem with someone creating a separate implementation of the Transaction Control service which leverages the OSGi JTA Service Specification. The reason that the current implementation doesn’t do this is twofold: By

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-14 Thread alexander.sahler
Hi Tim. I'm using the 2.6.1 version of aries jpa support already. Normal transaction control with blueprint and @Transactional annotation was working fine. To have better control over startup dependencies and cope with disappearing and appearing services during runtime we invest some time in a

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-13 Thread Timothy Ward
Hi Alexander, That looks like it should be fine - what version of Aries JPA are you using? There were some fixes made to Aries JPA in 2.4.0 to add support for JPA 2.1 configuration properties which are needed by the transaction control implementation, and I think that there were then more

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-13 Thread alexander.sahler
Thanks Tim for the update. I tried the approach with providing a factory config in karaf.dir/etc/org.apache.aries.tx.control.jpa.xa.cfg with config as: osgi.unit.name=DSContext2 osgi.jdbc.driver.class=org.h2.Driver url=jdbc:h2:mem:article user=sa password= whilst having a mininmal

Re: Antw: Re: OSGi Transaction control fails with hibernate

2017-09-13 Thread Timothy Ward
Hi Alexander, So what you’re doing is passing a fully configured EntityManagerFactory to the resource provider factory. If you create the provider this way then you are responsible for setting up all of the EntityManagerFactory’s configuration, including how it’s going to integrate with

Antw: Re: OSGi Transaction control fails with hibernate

2017-09-13 Thread alexander.sahler
Hi Tim, I use a JPAEntityManagerProviderFactory (providerFactory) which I inject as a service reference into my repository class. Furthermore, I inject a EntityManagerFactory (emf) into the repository class as well as the TransactionControl (txControl). The provider Factory is created by

Re: OSGi Transaction control fails with hibernate

2017-09-13 Thread Timothy Ward
Hi Alexander, Do you have a code example of how you’re obtaining and using the EntityManager? There should be no usage of the OSGiJtaPlatform from the tx-control XA JPA resource provider, which means that there’s either a bug in the resource provider, or something is misconfigured. If you are

Re: OSGi Transaction control fails with hibernate

2017-09-13 Thread Guillaume Nodet
Fwiw, you should ask on the Aries mailing list, where tx-control is developed. I've recently worked on a new project called pax-transx which provides an abstraction layer on top of transaction managers so that some features can be accessed in a common way. I think this should be used in

OSGi Transaction control fails with hibernate

2017-09-13 Thread alexander.sahler
Hello. I'm trying to get tx-control with XA transactions running (local is working). I found that tx-control opens a JTA transaction using RecoveryWorkAroundTransactionManager (derived from geronimo's TransactionManager Implementation) explicitly instead of using the registered