Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-933

IllegalStateException when the peristence bundle gets resolved.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.3, 1.0
    • jpa-2.0.0
    • JPA
    • None

    Description

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            cschneider Christian Schneider
            iocanel Ioannis Canellos
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment