Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 37054 invoked from network); 15 Apr 2009 01:31:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Apr 2009 01:31:36 -0000 Received: (qmail 56542 invoked by uid 500); 15 Apr 2009 01:31:36 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 56473 invoked by uid 500); 15 Apr 2009 01:31:36 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 56460 invoked by uid 99); 15 Apr 2009 01:31:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Apr 2009 01:31:36 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists+1214986160035-208411@n2.nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Apr 2009 01:31:25 +0000 Received: from tervel.nabble.com ([192.168.236.150]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Lttxw-0001ho-RB for users@openjpa.apache.org; Tue, 14 Apr 2009 18:31:04 -0700 Message-ID: <1239759064835-2636345.post@n2.nabble.com> Date: Tue, 14 Apr 2009 18:31:04 -0700 (PDT) From: Pinaki Poddar To: users@openjpa.apache.org Subject: Re: openJPA detached object can not be serialized by Castor. is it related with pcStateManager? In-Reply-To: <1239755009886-2636117.post@n2.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: ppoddar@apache.org References: <1239755009886-2636117.post@n2.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hello, try the following configuration [1] OpenJPA detached object instance x (optionally) can carry a StateManager (pcStateManager) instance sm(x) which can track changes in x while x is not under OpenJPA managed context. This makes merging of x into a OpenJPA managed context more effective. The above configuration makes the detached instance x' serialization compatible with original x. Serialization behavior does change based on the detach state configuration and most likely not liked by Castor's marshaller. To narrow the cause, you should also enhance your domain classes at build-time [2]. [1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_detach_graph [2] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_pc_enhance_build 1. Environment: java1.5, OpenJPA 1.2.1 , castor 1.2 2. any object retrieved from database by OpenJPA cannot be serialized to xml by castor. No error message from org.exolab.castor.xml.Marshaller . The result xml file is completely empty 3. When the same persistent class is instantiated by "new" operator, the instantiated object can be serialized by castor. 4. The only different between "openJPA detached objects" and "new instantiated objects" is the "openJPA detached objects" has member pcStateManager = null. Questions: 1. is this behavior related the pcStateManager member in the detached persistent objects? 2. What is the purpose of pcStateManager ? 3.How does it affect the serialization behavior ? ----- Pinaki Poddar http://ppoddar.blogspot.com/ http://www.linkedin.com/in/pinakipoddar OpenJPA PMC Member/Committer JPA Expert Group Member -- View this message in context: http://n2.nabble.com/openJPA-detached-object-can-not-be-serialized-by-Castor.--is-it-related-with-pcStateManager--tp2636117p2636345.html Sent from the OpenJPA Users mailing list archive at Nabble.com.