Re: Aries error: No transaction currently active

2012-08-27 Thread johnsas
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.


Re: Aries error: No transaction currently active

2012-08-27 Thread johnsas
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:


   
   




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

2012-08-27 Thread Christoph Gritschenberger
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