aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Ross (JIRA)" <>
Subject [jira] [Commented] (ARIES-933) IllegalStateException when the peristence bundle gets resolved.
Date Fri, 15 Mar 2013 12:40:13 GMT


John Ross commented on ARIES-933:

After reviewing related defects ARIES-832 and ARIES-978, I see there is great concern over
breaking existing clients not affected by the ISE even if it occurs and whose entity manager
factories must be created in the RESOLVED state.

What if we have EntityManagerFactoryManager.bundleStateChange react to a JPA property specified
in the persistence.xml? The default behavior would be the same (i.e. emfs would be created
in RESOLVED), but if the property was a certain value, the emfs would be created in the STARTING
state. Perhaps this would be more of a workaround than a solution, but at least it would give
folks a way to get past this issue.
> IllegalStateException when the peristence bundle gets resolved.
> ---------------------------------------------------------------
>                 Key: ARIES-933
>                 URL:
>             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
> 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:

View raw message