Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 91946 invoked from network); 25 Aug 2008 18:56:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Aug 2008 18:56:05 -0000 Received: (qmail 11197 invoked by uid 500); 25 Aug 2008 18:56:03 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 11186 invoked by uid 99); 25 Aug 2008 18:56:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2008 11:56:03 -0700 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2008 18:55:14 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 51EAA234C1BB for ; Mon, 25 Aug 2008 11:55:44 -0700 (PDT) Message-ID: <621389784.1219690544334.JavaMail.jira@brutus> Date: Mon, 25 Aug 2008 11:55:44 -0700 (PDT) From: "Craig Russell (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Commented: (JDO-558) Create tests for the serialization of PersistenceManagerFactory/PersistenceManager In-Reply-To: <14616394.1196453623036.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JDO-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625462#action_12625462 ] Craig Russell commented on JDO-558: ----------------------------------- For reference, I've updated the assertions in the specification: Serialization Serialization of a persistence manager factory allows an application to preserve a reference to the factory via calling writeObject on it and having its state preserved by writing it to a stream in an external form. Later, the state can be read from a stream and a functionally equivalent instance of the factory can be restored. When serializing the state of a persistence manager factory, the properties used to create the factory must be serialized. Some of the properties might depend on the context of the Java VM, and so are not able to be serialized. These properties may include the registered life cycle listener instances, class loaders, and any other values that are not serializable. A11.10-1 [If the persistence manager factory was created via the getPersistenceManagerFactory(Map props) method, then the serializable properties in props must be written to the stream and upon restoration, used to construct or locate the persistence manager factory in the new context. ] A11.10-2 [If the persistence manager factory was created via the javax.persistence.Persistence.createEntityManagerFactory (Map overrides, String name) method, then the persistence manager factory must write the overrides and the name to the stream and use these parameters in the new context to read the persistence.xml in the new context, use the overrides, and reconstruct the persistence manager factory. ] A11.10-3 [If the persistence manager factory was created via the JDOHelper.getPersistenceManagerFactory (Map overrides, String name) method, then the persistence manager factory must write the overrides and the name to the stream and use these parameters in the new context to read the jdoconfig.xml in the new context, use the overrides, and reconstruct the persistence manager factory. ] If the persistence manager factory was created via the getPersistenceManagerFactory(Map overrides, Map props) method, then the serializable properties in the overrides must be written to the stream and upon restoration, used to establish overrides for the persistence manager factory in the new context. The treatment of the props parameter depends on the existence of certain entries: A11.10-4 [If the property javax.jdo.spi.PropertiesFileName is a key in the props, then the value of this key and the overrides must be written to the stream and used in the new context to recreate the persistence manager factory from the file name. ] A11.10-5 [If the property javax.jdo.Name is a key in the props, then the value of this key and the overrides must be written to the stream and used in the new context to recreate the persistence manager factory from jdoconfig.xml. ] I'm going to focus on assertion A11.10-1 for this round of the TCK. > Create tests for the serialization of PersistenceManagerFactory/PersistenceManager > ---------------------------------------------------------------------------------- > > Key: JDO-558 > URL: https://issues.apache.org/jira/browse/JDO-558 > Project: JDO > Issue Type: Task > Components: tck2, tck2-legacy > Affects Versions: JDO 2 maintenance release 1 > Reporter: Matthew T. Adams > Assignee: Craig Russell > Fix For: JDO 2 maintenance release 2 > > > Serialization of PMFs/PMs needs to be tested as part of the TCK. Forthcoming spec updates on PM serialization will need assertions. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.