Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 69720 invoked from network); 12 Jul 2010 18:11:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Jul 2010 18:11:46 -0000 Received: (qmail 707 invoked by uid 500); 12 Jul 2010 18:11:46 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 494 invoked by uid 500); 12 Jul 2010 18:11:46 -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 484 invoked by uid 99); 12 Jul 2010 18:11:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jul 2010 18:11:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jul 2010 18:11:43 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o6CI3qj3009155 for ; Mon, 12 Jul 2010 18:03:52 GMT Message-ID: <10883540.329391278957832113.JavaMail.jira@thor> Date: Mon, 12 Jul 2010 14:03:52 -0400 (EDT) From: "Dianne Richards (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Work started: (OPENJPA-1722) Problem serializing DistinctResultList when EntityManager is closed In-Reply-To: <23768718.329371278957831874.JavaMail.jira@thor> 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-1722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Work on OPENJPA-1722 started by Dianne Richards. > Problem serializing DistinctResultList when EntityManager is closed > ------------------------------------------------------------------- > > Key: OPENJPA-1722 > URL: https://issues.apache.org/jira/browse/OPENJPA-1722 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 2.1.0 > Reporter: Dianne Richards > Assignee: Dianne Richards > Fix For: 2.1.0 > > > A client application that worked earlier is now failing in 2.10, relating to the serialization of the DistinctResultList. It does a distinct query followed by a getResultList(). A DistinctResultList is returned from the query, where a DelegatingResultList used to be returned. The EntityManager is closed before the serialization occurs. It fails with the exception: org.apache.openjpa.persistence.InvalidStateException: The context has been closed. > Here's what is happening: The DistinctResultList contains a RuntimeExceptionTranslator object which contains the closed EntityManager. The writeObject() in the enclosed BrokerImpl does an assertOpen(), which issues the exception. > The DelegatingResultList also contains the RuntimeExceptionTranslator. But, it contains a writeResult() method which is called during serialization. This only attempts to write the ResultList object, not the RuntimeExceptionTranslator object. > So, I will add the writeResult() method to the DistinctResultList class. In this case, it will write an ArrayList instead of a ResultList object. This should be ok since the method signature is for a List. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.