Return-Path: X-Original-To: apmail-aries-dev-archive@www.apache.org Delivered-To: apmail-aries-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0D8F3D0AA for ; Fri, 5 Oct 2012 13:50:03 +0000 (UTC) Received: (qmail 87741 invoked by uid 500); 5 Oct 2012 13:50:02 -0000 Delivered-To: apmail-aries-dev-archive@aries.apache.org Received: (qmail 87697 invoked by uid 500); 5 Oct 2012 13:50:02 -0000 Mailing-List: contact dev-help@aries.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aries.apache.org Delivered-To: mailing list dev@aries.apache.org Received: (qmail 87688 invoked by uid 99); 5 Oct 2012 13:50:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 13:50:02 +0000 Date: Fri, 5 Oct 2012 13:50:02 +0000 (UTC) From: "Ioannis Canellos (JIRA)" To: dev@aries.apache.org Message-ID: <1353317023.860.1349445002886.JavaMail.jiratomcat@arcas> In-Reply-To: <405466383.72.1349430183577.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (ARIES-933) IllegalStateException when the peristence bundle gets resolved. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ARIES-933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ioannis Canellos updated ARIES-933: ----------------------------------- Attachment: ARIES-933.patch I am attaching a patch which catch exception and cleans up emfs, when an error occurs during creation of emfs in the resolved bundle state. > 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