Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-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 CDC7292D8 for ; Tue, 21 Feb 2012 21:29:15 +0000 (UTC) Received: (qmail 17696 invoked by uid 500); 21 Feb 2012 21:29:15 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 17649 invoked by uid 500); 21 Feb 2012 21:29:15 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 17623 invoked by uid 99); 21 Feb 2012 21:29:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Feb 2012 21:29:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Feb 2012 21:29:09 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C5CAF1C297F for ; Tue, 21 Feb 2012 21:28:48 +0000 (UTC) Date: Tue, 21 Feb 2012 21:28:48 +0000 (UTC) From: "Rick Curtis (Commented) (JIRA)" To: dev@openjpa.apache.org Message-ID: <1499352816.1049.1329859728812.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1142039158.646.1329855528875.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (OPENJPA-2136) NPE when using LiteAutoDetach MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-2136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13212967#comment-13212967 ] Rick Curtis commented on OPENJPA-2136: -------------------------------------- Committed revision 1292040 to 2.2.x. > NPE when using LiteAutoDetach > ------------------------------ > > Key: OPENJPA-2136 > URL: https://issues.apache.org/jira/browse/OPENJPA-2136 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 2.0.0, 2.1.1, 2.2.0, 2.3.0 > Reporter: Rick Curtis > Assignee: Rick Curtis > Fix For: 2.3.0, 2.2.1 > > > I encountered a NPE[2] today when using the LiteAutoDetach[1] configuration property. The steps required to cause this problem is as follows: > - Configure LiteAutoDetach for your PU. > - Find a non-transactional Entity. > - Clear the EntityManager. > - Begin / commit transaction. > The problem is that LiteAutoDetach doesn't properly clean up the EntityManager while it is performing lite detachment. State is left in BrokerImpl._pending set which is then incorrectly used post em.clear. It also appears that there are a number of other BrokerImpl datastructures that *should* have been cleaned up on clear / detachall. > [1] http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#ref_guide_detach_state > [2] Caused by: org.apache.openjpa.persistence.PersistenceException: null > at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1998) > at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81) > at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1514) > at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:933) > at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:570) > ... 24 more > Caused by: java.lang.NullPointerException > at org.apache.openjpa.Customer.pcProvideField(Customer.java) > at org.apache.openjpa.kernel.StateManagerImpl.provideField(StateManagerImpl.java:3161) > at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2980) > at org.apache.openjpa.kernel.PDirtyState.beforeFlush(PDirtyState.java:38) > at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1053) > at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2112) > at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2072) > at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1990) > ... 28 more -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira