Issue Details (XML | Word | Printable)

Key: JDO-428
Type: Bug Bug
Status: Resolved Resolved
Resolution: Invalid
Priority: Minor Minor
Assignee: Craig Russell
Reporter: Marc Prud'hommeaux
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JDO

StateTransitionsReturnedObjects disallows makePersistent() on a detached-clean instance from being hollow

Created: 17/Sep/06 05:14 AM   Updated: 10/Oct/06 05:50 PM
Return to search
Component/s: tck2
Affects Version/s: JDO 2 final
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 10/Oct/06 05:50 PM


 Description  « Hide
Element 10 (0-based) of the "makePersistent" array in org/apache/jdo/tck/lifecycle/StateTransitionsReturnedObjects.java asserts that a detached-clean instance passed to makePersistent() should have the resulting object be in the "persistent-clean" state. However, section 12.6.7 of the JDO 2 spec merely says that: "During application of changes of the detached state, if the JDO implementation can determine that there were no changes made during detachment, then the implementation is not required to mark the corresponding instance dirty." Based on this, it should be legal for the object to be in either the hollow state as well as the persistent-clean state.

The easiest fix, short of changing the test case to allow for multiple states, is to change element 10 from "PERSISTENT_CLEAN" to "IMPOSSIBLE", which will disable the state check altogether.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig Russell made changes - 04/Oct/06 02:51 AM
Field Original Value New Value
Assignee Craig Russell [ clr ]
Craig Russell added a comment - 04/Oct/06 02:58 AM
It might be surprising for users who attach a detached instance and the clean state of the instance silently disappears. Why is this desirable?

The answer will determine whether we consider this a spec bug to be fixed to specify that attaching a detached-clean instance results in a persistent-clean state or specify that the state can be persistent-clean or hollow.

Craig Russell made changes - 04/Oct/06 09:19 PM
Fix Version/s JDO 2.0 TCK challenge fixes [ 12312093 ]
Fix Version/s JDO 2 maintenance release 1 [ 12310923 ]
Matthew T. Adams added a comment - 04/Oct/06 10:43 PM
How does the current fetch plan affect this?

Craig Russell added a comment - 10/Oct/06 12:35 AM
The current fetch plan should not affect this behavior. The issue is what happens upon attachment via calling the makePersistent method. The fetch plan is operative during detachment and is not specified to have any effect on attachment.

Craig Russell added a comment - 10/Oct/06 05:50 PM
The spec describes what happens in the description of makePersistent:

<spec>
For a detached instance, they locate or create a persistent
instance with the same JDO identity as the detached instance, and merge the persistent
state of the detached instance into the persistent instance. Only the state of persistent fields
is merged.
</spec>

The merge operation cannot result in a hollow instance.

Craig Russell made changes - 10/Oct/06 05:50 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s JDO 2 maintenance release 1 [ 12310923 ]
Resolution Invalid [ 6 ]
Fix Version/s JDO 2.0 TCK challenge fixes [ 12312093 ]