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