[ 
https://issues.apache.org/jira/browse/ARIES-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598856#comment-13598856
 ] 

John Ross commented on ARIES-933:
---------------------------------

Note that the strategy of catching exceptions and cleaning up emfs used by the 
current patch will not solve the issue at hand. The IllegalStateException 
thrown by org.apache.aries.jpa.container.unit.impl.JndiDataSource is completely 
consumed by OpenJPA in 
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceUnitInfo,
 Map), so the catch and cleanup will never occur, which means a second attempt 
will never be made.


                
> IllegalStateException when the peristence bundle gets resolved.
> ---------------------------------------------------------------
>
>                 Key: ARIES-933
>                 URL: https://issues.apache.org/jira/browse/ARIES-933
>             Project: Aries
>          Issue Type: Bug
>          Components: JPA
>    Affects Versions: 0.3, 1.0
>            Reporter: Ioannis Canellos
>         Attachments: ARIES-933.patch
>
>
> Aries JPA tries to create the entity manager factories when the persistence 
> bundle gets in resolved state.
> With some persistence providers this can cause issues. For example Hibernate 
> will try to access the datasource via jndi when creating the EMF, causing the 
> IllegalStateException due to the fact that the persistnce bundle still has 
> not context (is in resolved state).
> Even worse it will leave the EntityManagerFactoryManager is a wrong state, 
> preventing it to create the EMF when the bundle is created.
> There are two ways of approaching this issue:
> i) Don't try to create EMF when the persistence bundle gets resolved.
> ii) Catch possible errors and cleanup, so that EMF can be created when the 
> bundle gets started.
> I am going to attach a patch for the first appraoch, unless there is a good 
> way for creating EMF when the bundle gets resolved.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to