Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/DesignDocs/305401

Enhancement 305401 - SDO Serialization using local HelperContext

Getting the Local Helper Context

The following API on SDOHelperContext will allow you to obtain a local HelperContext. Local helperContexts will be isolated at the same level that global helpers are today.

/**
* Return the local helper context with the given identifier, or create
* one if it does not already exist. This method must be thread safe.
* The identifiers must be unique in the same scope as the global HelperContexts.
*/
public static SDOHelperContext getHelperContext(String identifier);
i.e.
SDOHelperContext.getHelperContext("servicename").getDataFactory();


Redefining the Metadata

The following API on SDOHelperContext is relevant to redefining the metadata. Essentially you create a new HelperContext, define the new metadata, and replace the old one.

/**
* Create a HelperContext with the given identifier.
*/
public SDOHelperContext(String identifier);

/**
* Replace the HelperContext associated with this identifer.
*/
public static void putHelperContext(SDOHelperContext helperContext);

i.e.
// "servicename" is the identifier for the HelperContext being replaced
SDOHelperContext newHelperContext = new SDOHelperContext("servicename");
newHelperContext.getXSDHelper().define(...);
SDOHelperContext.putHelperContext(newHelperContext);


DataObjects created with Old Metadata

When the HelperContext is replaced you may have DataObjects created with an older version of the HelperContext that you still need to work with (they would still point to the old types & properties). If required, we could add the following method to DataHelper (from SDO 3.0) that would enable "compatible" DataObjects to be moved from the old HelperContext to the new one.

DataObject project(DataObject originalObject);

Essentially "compatible" means that I could marshal the DataObjects to XML using the old HelperContext and then unmarshal them using the new HelperContext. Note there are no restrictions on the types of "redefine" that can be made, only a restriction on migrating old DataObjects to the new Types and Properties.


RMI Serialization

On the source and target there must be a local HelperContext with the same identifier (uri/name) with matching metadata. With this contract in place RMI serialization will happen transparently.


Back to the top