Re: Aries error: No transaction currently active
Hi, Thank you for the explanation. I think we found the cause. We had Apache Aries Transaction Manager (0.3.0) and Apache Aries Transaction Manager (0.3.1) installed in parallel. 0.3.0 was installed by the Activemq feature and 0.3.1 was installed by the Karaf enterprise transaction feature. After removing the 0.3.1 version the error dissapeared. John -- View this message in context: http://karaf.922171.n3.nabble.com/Aries-error-No-transaction-currently-active-tp4025825p4025866.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Aries error: No transaction currently active
Hi, Both of those EntityManagerFactory services are being used. The first one (service id 350) is the real EMF from the JPA provider. The second is used by the Aties runtime to support the jpa:context .../ tag; it is marked as a proxy factory using a custom service property, and creates container-managed entity manager instances. The first service is used by the persistence bundle. The second is used by the persistence client (the bundle being injected with the EntityManager). I hope that helps. Tim -- View this message in context: http://karaf.922171.n3.nabble.com/Aries-error-No-transaction-currently-active-tp4025825p4025861.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Aries error: No transaction currently active
Hi, There seems to be some race-condition in aries there. Something similar has been reported previously [1] [2]. I think we were able to fix it by synchronizing entity-manager-access with synchronized-blocks synchronized(entityManager){ entityManager.merge(...); } kind regards, christoph [1] http://karaf.922171.n3.nabble.com/Exception-No-transaction-currently-active-td4025308.html [2] http://mail-archives.apache.org/mod_mbox/aries-dev/201207.mbox/%3CCAEQV%2BEEhx4zNS%3D9MbxBhBUfedeC8F%3DBvGXn7v49EzwYxBJdf3g%40mail.gmail.com%3E On 25/08/12 10:12, johnsas wrote: Hi, I am using Aries 0.3 for transaction management in Karaf 2.2.8. It works in gereral but sometimes I get the following exception when accessing a database: javax.persistence.TransactionRequiredException: No transaction currently active at org.apache.aries.jpa.container.context.transaction.impl.JTAPersistenceContextRegistry.getCurrentPersistenceContext(JTAPersistenceContextRegistry.java:103) at org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.getPersistenceContext(JTAEntityManager.java:83) at org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.merge(JTAEntityManager.java:270) at org.xxx.persistence.impl.DatabaseProviderDao.merge(DatabaseProviderDao.java:304) This error occurs out of the blue. Do you have an idea why this happens, and what can be done to avoid it? -- View this message in context: http://karaf.922171.n3.nabble.com/Aries-error-No-transaction-currently-active-tp4025825.html Sent from the Karaf - User mailing list archive at Nabble.com. smime.p7s Description: S/MIME Cryptographic Signature
Re: Aries error: No transaction currently active
Hi, It seems that the issue was fixed in ARIES-885. But this will only be available with Aries 1.0. Do you have an idea to synchronize all calls to the EM with Aries 0.3? We have a blueprint similar to this: bean id=serviceBean class=org.xxx.MyServiceImpl jpa:context unitname=store property=entityManager / tx:transaction method=* value=Required / /bean service ref=serviceBean interface=org.xxx.MyService / How can I replace the entityManager with one that synchronizes the calls? John -- View this message in context: http://karaf.922171.n3.nabble.com/Aries-error-No-transaction-currently-active-tp4025825p4025844.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Aries error: No transaction currently active
What I don't understand is why my persistence bundle exports two EntityManagerFactory Services. Component (44) provides: objectClass = javax.persistence.EntityManagerFactory org.apache.aries.jpa.container.managed = true org.apache.aries.jpa.default.unit.name = false osgi.unit.name = registry osgi.unit.provider = org.eclipse.persistence.jpa.PersistenceProvider osgi.unit.version = 1.0.0 service.id = 350 objectClass = javax.persistence.EntityManagerFactory org.apache.aries.jpa.container.managed = true org.apache.aries.jpa.default.unit.name = false org.apache.aries.jpa.proxy.factory = true osgi.unit.name = registry osgi.unit.provider = org.eclipse.persistence.jpa.PersistenceProvider osgi.unit.version = 1.0.0 service.id = 351 objectClass = xxx.Registry osgi.service.blueprint.compname = registryService service.id = 379 version = 1 objectClass = org.osgi.service.blueprint.container.BlueprintContainer osgi.blueprint.container.symbolicname = org.oparo.services.registry.registry-component osgi.blueprint.container.version = 1.0.0 service.id = 389 Is this normal behaviour? If yes, which bundle is using those OSGi-services? -- View this message in context: http://karaf.922171.n3.nabble.com/Aries-error-No-transaction-currently-active-tp4025825p4025846.html Sent from the Karaf - User mailing list archive at Nabble.com.
Aries error: No transaction currently active
Hi, I am using Aries 0.3 for transaction management in Karaf 2.2.8. It works in gereral but sometimes I get the following exception when accessing a database: javax.persistence.TransactionRequiredException: No transaction currently active at org.apache.aries.jpa.container.context.transaction.impl.JTAPersistenceContextRegistry.getCurrentPersistenceContext(JTAPersistenceContextRegistry.java:103) at org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.getPersistenceContext(JTAEntityManager.java:83) at org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.merge(JTAEntityManager.java:270) at org.xxx.persistence.impl.DatabaseProviderDao.merge(DatabaseProviderDao.java:304) This error occurs out of the blue. Do you have an idea why this happens, and what can be done to avoid it? -- View this message in context: http://karaf.922171.n3.nabble.com/Aries-error-No-transaction-currently-active-tp4025825.html Sent from the Karaf - User mailing list archive at Nabble.com.