aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Ward (Commented) (JIRA)" <>
Subject [jira] [Commented] (ARIES-765) Attempting to execute an operation on a closed EntityManagerFactory when the persistence unit is re-deployed
Date Tue, 25 Oct 2011 13:38:32 GMT


Timothy Ward commented on ARIES-765:

There is one more thing I should add. This scenario violates the packaging required by the
JPA service specification, which states that the Entity Classes should live inside the persistence
bundle. If you were to do this then you would not see this problem as the client would be
refreshed to pick up the new entity class package.

Packaging the Entity Classes separately from the persistence unit definition is a poor modularity
pattern because the entity classes are tightly bound to the database configuration and mapping
information from the persistence unit. I would strongly recommend against this pattern.
> Attempting to execute an operation on a closed EntityManagerFactory when the persistence
unit is re-deployed
> ------------------------------------------------------------------------------------------------------------
>                 Key: ARIES-765
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint, JPA
>    Affects Versions: 0.3
>         Environment: Glassfish 3.1.1
>            Reporter: Balazs Zsoldos
> We use the JPA entities in the following way:
> - entities1.jar
> - entities2.jar
> - pu.jar
> The first two contains entity classes but no persistence unit, the third contains the
Meta-Persistence header and a persistence.xml file (named to something else not to be realized
by Glassfish)
> We use the persistence unit with blueprint.
> When we re-deploy the pu.jar we have to re-deploy everything else (even the jars that
do contain only services that are related to unchanged entity classes) manually as the following
exception occurs:
> java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManagerFactory.
> 	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.verifyOpen(
> 	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(
> 	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(
> 	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(
> 	at org.apache.aries.jpa.container.impl.CountingEntityManagerFactory.createEntityManager(
> 	at org.apache.aries.jpa.container.context.transaction.impl.JTAPersistenceContextRegistry.getCurrentPersistenceContext(
> 	at org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.getPersistenceContext(
> 	at org.apache.aries.jpa.container.context.transaction.impl.JTAEntityManager.getCriteriaBuilder(
> It would be nice if JTAEntityManager would realize when the persistence unit gets redeployed
and would use the new instance.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message