You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Nikita Timofeev (JIRA)" <ji...@apache.org> on 2017/03/22 15:12:41 UTC
[jira] [Closed] (CAY-2243)
ObjectContext.getGraphManager().unregisterObject() inconsistencies
[ https://issues.apache.org/jira/browse/CAY-2243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nikita Timofeev closed CAY-2243.
--------------------------------
Resolution: Fixed
Assignee: Nikita Timofeev
https://github.com/apache/cayenne/commit/a0ef5ad2411f05c23ce8e609a7eabe686b642be3
> ObjectContext.getGraphManager().unregisterObject() inconsistencies
> ------------------------------------------------------------------
>
> Key: CAY-2243
> URL: https://issues.apache.org/jira/browse/CAY-2243
> Project: Cayenne
> Issue Type: Bug
> Affects Versions: 3.1.1, 4.0.M4
> Reporter: Andrus Adamchik
> Assignee: Nikita Timofeev
> Priority: Minor
> Fix For: 4.0.M6
>
>
> ObjectContext.getGraphManager().unregisterObject() behaves inconsistently between ROP and regular Cayenne in regards to the object state after unregistering, and I don't think either one of the two is fully correct.
> 1. Here is the desired behavior, which seems like the most reasonable outcome - ObjectContext is set to null, persistent state - to TRANSIENT, ObjectId is preserved. I.e. object is kicked out of the context, but does not lose its identity:
> graphManager.unregisterNode(object.getObjectId());
> verify(object, times(0)).setObjectId(null);
> verify(object).setObjectContext(null);
> verify(object).setPersistenceState(PersistenceState.TRANSIENT);
> 2. ROP Behavior:
> // succeeds
> verify(object, times(0)).setObjectId(null);
> // fails
> verify(object).setObjectContext(null);
> // fails
> verify(object).setPersistenceState(PersistenceState.TRANSIENT);
> 3. Server Behavior:
> // fails
> verify(object, times(0)).setObjectId(null);
> // succeeds
> verify(object).setObjectContext(null);
> // succeeds
> verify(object).setPersistenceState(PersistenceState.TRANSIENT);
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)