Re: MariaDB/JPA Transaction rollback not working

2018-05-21 Thread Jean-Baptiste Onofré
By the way: https://github.com/apache/karaf/pull/509 This is my PR containing the SCR 2.1.0 update (I gonna merge once Jenkins is OK). Regards JB On 21/05/2018 20:59, Alex Soto wrote: I changed to JTA and it seems better.  Any idea when Karaf 4.2.1 will be out? Best regards, Alex soto

Re: MariaDB/JPA Transaction rollback not working

2018-05-21 Thread Jean-Baptiste Onofré
I'm planning 4.2.1 in around 3 weeks as I have lot of changes in progress. Regards JB On 21/05/2018 20:59, Alex Soto wrote: I changed to JTA and it seems better.  Any idea when Karaf 4.2.1 will be out? Best regards, Alex soto On May 21, 2018, at 2:34 PM, Jean-Baptiste Onofré

Re: MariaDB/JPA Transaction rollback not working

2018-05-21 Thread Alex Soto
I changed to JTA and it seems better. Any idea when Karaf 4.2.1 will be out? Best regards, Alex soto > On May 21, 2018, at 2:34 PM, Jean-Baptiste Onofré wrote: > > Hi Tim, > > as said in my previous mail, SCR 2.1.0 is already ready on a branch and it > will be

Re: MariaDB/JPA Transaction rollback not working

2018-05-21 Thread Jean-Baptiste Onofré
Hi Tim, as said in my previous mail, SCR 2.1.0 is already ready on a branch and it will be included in Karaf 4.2.1. Regards JB On 21/05/2018 20:32, Tim Ward wrote: The JpaTemplate is not very sophisticated, and I was considering deprecating it now Transaction Control is available. The

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Jean-Baptiste Onofré
Hi Alex, I don't think it's a good idea to update only SCR without updating other part of Karaf (ClassNotFoundException seems to come from a compendium package). I strongly recommend to focus on the current 4.2.0 distribution and clearly list the issue to me: I will add a sample

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Tim Ward
That actually doesn’t look like a fatal exception, all that’s happening is that Metatype is unable to retrieve the ManagedService from SCR. It may indicate a problem down the line with receiving config though. Tim Sent from my iPhone > On 19 May 2018, at 03:36, David Jencks

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread David Jencks
Maybe try upgrading config admin also? There are a lot of new capabilities ds takes advantage of. David Jencks Sent from my iPhone > On May 18, 2018, at 11:07 AM, Alex Soto wrote: > > Tried adding Felix SCR 2.1.0, but it looks like it is not as simple: > >

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Alex Soto
Tried adding Felix SCR 2.1.0, but it looks like it is not as simple: org.osgi.framework.ServiceException: Service factory exception: org/osgi/service/cm/ManagedService at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:352) ~[?:?]

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Alex Soto
Hi JB, Which branch, I’d like to try it. Best regards, Alex soto > On May 18, 2018, at 12:46 PM, Jean-Baptiste Onofré wrote: > > 4.2.1-SNAPSHOT already updated to DS 1.4 (SCR 2.1.0) (ready on one of my > branch). > > Regards > JB > > On 18/05/2018 17:50, Alex Soto

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Jean-Baptiste Onofré
4.2.1-SNAPSHOT already updated to DS 1.4 (SCR 2.1.0) (ready on one of my branch). Regards JB On 18/05/2018 17:50, Alex Soto wrote: Great, I solved the Eclipse problem.  Thanks. Yes, Karaf provides DS 1.3,  but no DS 1.4 out off the box. Maybe this is available from Aries? Best regards, Alex

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Tim Ward
This is the one you want https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.scr/2.1.0 1.4 is backward compatible with 1.3 so it should be possible to just do a drop-in replacement. Tim Sent from my iPhone > On 18 May 2018, at 17:50, Alex Soto wrote:

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Alex Soto
Great, I solved the Eclipse problem. Thanks. Yes, Karaf provides DS 1.3, but no DS 1.4 out off the box. Maybe this is available from Aries? Best regards, Alex soto > On May 18, 2018, at 11:18 AM, Tim Ward wrote: > > Hi, > > Answers inline: > > Sent from my iPhone

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Tim Ward
Hi, Answers inline: Sent from my iPhone > On 18 May 2018, at 16:55, Alex Soto wrote: > > Thank you Tim for the very detailed explanation. > There are two problems I don’t know how to resolve: > > 1- BND generates this for my bundle: > >

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Alex Soto
Actually, BND is adding two Require-Capabiility entries for osgi.component with different versions: Require-Capability

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Alex Soto
Thank you Tim for the very detailed explanation. There are two problems I don’t know how to resolve: 1- BND generates this for my bundle: Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))” This is because

Re: MariaDB/JPA Transaction rollback not working

2018-05-18 Thread Tim Ward
Hi Alex, The bundles you need are listed in the bndrun for the JPA version of the enRoute application, but as I think you’re using OpenJPA (rather than Hibernate) it may help to explain things in relation to the Transaction Control JPA integration test for OpenJPA. I’m sure that at least some

Re: MariaDB/JPA Transaction rollback not working

2018-05-17 Thread Alex Soto
Thanks Tim, I was using branch R7, changed to master, it builds now. Now I have updated my project to OSGi 7 with Transaction Control, how do I deploy to Karaf? i.e., what bundles/features do I need? Best regards, Alex soto > On May 17, 2018, at 2:08 PM, Tim Ward

Re: MariaDB/JPA Transaction rollback not working

2018-05-17 Thread Tim Ward
Hi Alex, Bnd 4.0.0 was only released last Sunday, but this should have been changed yesterday in this commit https://github.com/osgi/osgi.enroute/commit/9f9857c3d317cd08a7aaf7327c1904676299f9ee to make sure enRoute kept building. EnRoute is automatically pushed to the sonatype OSGi nexus

Re: MariaDB/JPA Transaction rollback not working

2018-05-17 Thread Alex Soto
Allright,  I am trying to follow the EnRoute tutorial.I am getting this error:[ERROR] Plugin biz.aQute.bnd:bnd-maven-plugin:4.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact biz.aQute.bnd:bnd-maven-plugin:jar:4.0.0-SNAPSHOT in Bnd Snapshots 

Re: MariaDB/JPA Transaction rollback not working

2018-05-17 Thread Alex Soto
Allright, I am trying to follow the EnRoute tutorial. I am getting this error: [ERROR] Plugin biz.aQute.bnd:bnd-maven-plugin:4.0.0-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact biz.aQute.bnd:bnd-maven-plugin:jar:4.0.0-SNAPSHOT in Bnd Snapshots

Re: MariaDB/JPA Transaction rollback not working

2018-05-17 Thread Tim Ward
It is highly unlikely that you’ll hit the same issues. The transaction control resource provider uses the DataSourceFactory directly to create a DataSource (either progamatically using a factory service or via config admin) that enlists itself in the ongoing transaction. This means that the

Re: MariaDB/JPA Transaction rollback not working

2018-05-17 Thread Alex Soto
I will take a look at these examples. However, I think that if I cannot get a MariaDB DataSource that supports transactions, then it will still not work, right? If the examples use H2 database, I still may get different results when I change to MariaDB, and I will find myself in the same spot

Re: MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Tim Ward
The best place to start when looking for OSGi R7 examples is the enRoute Project. It contains Maven Archetypes, examples and worked tutorials for building applications using R7 specifications. https://enroute.osgi.org Most of the projects in use are just new versions of long established OSGi

Re: MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Jean-Baptiste Onofré
Hi Alex, I fully agree, and we know it's an area where we have to improve. That's why we started a fully set of examples that will be: 1. part of the Karaf distribution 2. used in the itests to verify the behavior is correct. You can find the WIP on the example here:

Re: MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Jean-Baptiste Onofré
Hi Alex, I fully agree, and we know it's an area where we have to improve. That's why we started a fully set of examples that will be: 1. part of the Karaf distribution 2. used in the itests to verify the behavior is correct. You can find the WIP on the example here:

Re: MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Tim Ward
The structure of the JNDI name is defined by the JNDI service specification. osgi:service/[/] So in this case both of your services should be DataSource instances, but they should have different filters. The important thing is to make sure you have an JTA enlisting DataSource registered as

Re: MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Alex Soto
I am calling flush on purpose, to be able to test, to force the data to be written to the database (not committed). Anyway, I changed my method to this: @Transactional(REQUIRES_NEW) public void addUser(User user) { List users = em.createQuery("Select u From User

Re: MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Tim Ward
Just looking quickly. You have the same JNDI name for both JTA and non JTA DataSources. This is clearly wrong as the DataSource cannot simultaneously be enlisted in the Transaction and not enlisted. The comments also indicate a misunderstanding of the purpose of the non-jta-datasource, which

Re: MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Jean-Baptiste Onofré
Are you sure about your code ? Flush looks weird to me and it seems you don't use container managed transaction. Regards JB On 16/05/2018 21:08, Alex Soto wrote: Yes, same result.  I even tried with Narayana Transaction Manager, and same result. Best regards, Alex soto On May 16, 2018,

Re: MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Alex Soto
Yes, same result. I even tried with Narayana Transaction Manager, and same result. Best regards, Alex soto > On May 16, 2018, at 2:56 PM, Jean-Baptiste Onofré wrote: > > Same behavior with RequiresNew ? > > Regards > JB > > On 16/05/2018 19:44, Alex Soto wrote: >>

Re: MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Jean-Baptiste Onofré
Same behavior with RequiresNew ? Regards JB On 16/05/2018 19:44, Alex Soto wrote: With Karaf version 4.2.0, Rollback is not working with MariaDB and InnoDB tables. I deployed these features (from Karaf’s enterprise  repository): aries-blueprint transaction jndi jdbc jpa pax-jdbc-mariadb    

MariaDB/JPA Transaction rollback not working

2018-05-16 Thread Alex Soto
With Karaf version 4.2.0, Rollback is not working with MariaDB and InnoDB tables. I deployed these features (from Karaf’s enterprise repository): aries-blueprint transaction jndi jdbc jpa