You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Matthew T. Adams (JIRA)" <ji...@apache.org> on 2007/11/30 21:13:43 UTC

[jira] Created: (JDO-558) Create tests for the serialization of PersistenceManagerFactory/PersistenceManager

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


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.


[jira] Updated: (JDO-558) Create tests for the serialization of PersistenceManagerFactory/PersistenceManager

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-558:
------------------------------

    Attachment: jdo-558.patch

This test serializes and materializes a PMF and makes sure the restored PMF is usable.

With the current DataNucleus svn the test fails.

> 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
>
>         Attachments: jdo-558.patch
>
>
> 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.


[jira] Commented: (JDO-558) Create tests for the serialization of PersistenceManagerFactory/PersistenceManager

Posted by "Craig Russell (JIRA)" <ji...@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.


[jira] Updated: (JDO-558) Create tests for the serialization of PersistenceManagerFactory/PersistenceManager

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-558:
---------------------------------

    Fix Version/s:     (was: JDO 2 maintenance release 2)
                   JDO 2 maintenance release 3

> 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 3
>
>         Attachments: jdo-558.patch
>
>
> 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.


[jira] Commented: (JDO-558) Create tests for the serialization of PersistenceManagerFactory/PersistenceManager

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12624110#action_12624110 ] 

Craig Russell commented on JDO-558:
-----------------------------------

Tests will serialize a PMF and then materialize it in the same VM (easy with the current JUnit setup), and make sure it's equivalent by getting a PM and trying to retrieve an instance by its id. 

A different test will serialize a PM and materialize it in the same VM. It should also be possible to retrieve an instance that was stored using the previous PMF.

Another set of tests will create a new VM and try to materialize PMF and PM. This is more tricky with the current maven/JUnit setup since another VM needs to be created and communications established between the VMs.




> 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.


[jira] Updated: (JDO-558) Create tests for the serialization of PersistenceManagerFactory/PersistenceManager

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-558:
------------------------------

    Fix Version/s: JDO 2 maintenance release 2
         Assignee: Craig Russell

> 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.


[jira] Updated: (JDO-558) Create tests for the serialization of PersistenceManagerFactory/PersistenceManager

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-558:
------------------------------

    Fix Version/s:     (was: JDO 2 maintenance release 3)

Defer until next maintenance release.

> 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
>         Attachments: jdo-558.patch
>
>
> 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.