Provide alternative StateManager(s) for other persistence conditions

We currently provide a StateManager that supports the full range of persistence capabilities : embedded, referential integrity, etc. We could provide at least three alternates (inheriting behaviour as appropriate)
1. StateManager for datastores that don't have referential integrity.
2. StateManager for datastores that don't have referential integrity and for embedded objects.
3. StateManager for datastores that have referential integrity and for embedded objects.

This way we instantiate the right type based on the StoreManager and the object being managed, and we benefit in terms of memory utilisation.

Description

We currently provide a StateManager that supports the full range of persistence capabilities : embedded, referential integrity, etc. We could provide at least three alternates (inheriting behaviour as appropriate)
1. StateManager for datastores that don't have referential integrity.
2. StateManager for datastores that don't have referential integrity and for embedded objects.
3. StateManager for datastores that have referential integrity and for embedded objects.
This way we instantiate the right type based on the StoreManager and the object being managed, and we benefit in terms of memory utilisation.

Refer to ObjectManagerImpl "smFactory" usage for completing this issue. Need to generate alternate ObjectProvider, and associated ObjectProviderFactory, and then update ObjectManagerImpl to make use of the other factory

Andy Jefferson added a comment - 10/Oct/12 05:02 PM Refer to ObjectManagerImpl "smFactory" usage for completing this issue. Need to generate alternate ObjectProvider, and associated ObjectProviderFactory, and then update ObjectManagerImpl to make use of the other factory

SVN trunk now allows "datanucleus.objectProvider.className" so a user can set the ObjectProvider class to use. Also the embedded fields of JDOStateManager are now offloaded into ExecutionContext (hence no need to have an ObjectProvider to cater for non-embedded). The only obvious additional ObjectProvider needed is for non-RDBMS datastores that don't need the "insertLevel" logic (and associated fields)

Andy Jefferson added a comment - 16/Jul/13 12:27 PM SVN trunk now allows "datanucleus.objectProvider.className" so a user can set the ObjectProvider class to use. Also the embedded fields of JDOStateManager are now offloaded into ExecutionContext (hence no need to have an ObjectProvider to cater for non-embedded). The only obvious additional ObjectProvider needed is for non-RDBMS datastores that don't need the "insertLevel" logic (and associated fields)