cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAY-2243) ObjectContext.getGraphManager().unregisterObject() inconsistencies
Date Wed, 22 Feb 2017 07:30:44 GMT

    [ https://issues.apache.org/jira/browse/CAY-2243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15877659#comment-15877659
] 

Andrus Adamchik commented on CAY-2243:
--------------------------------------

Here is a test showing the problem (and documenting the desired behavior) :  https://github.com/andrus/cayenne/commit/7d3ea21bcd5164b89d942562adadfe17e9d61786

> 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
>            Priority: Minor
>
> 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:
>         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)

Mime
View raw message