Issue Details (XML | Word | Printable)

Key: JDO-368
Type: Bug Bug
Status: Resolved Resolved
Resolution: Invalid
Priority: Major Major
Assignee: Craig Russell
Reporter: Dave
Votes: 0
Watchers: 0
Operations

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

AttachCallback javadoc issue

Created: 18/Apr/06 12:16 AM   Updated: 14/Oct/06 02:45 AM
Return to search
Component/s: api2
Affects Version/s: JDO 2 rc1
Fix Version/s: None

Time Tracking:
Not Specified

Environment: N/A

Resolution Date: 04/Jun/06 12:13 AM


 Description  « Hide
Javadoc issue.

Descriptions of the AttachCallback methods appear to be copied from DetachCallback. A copy is made during Detach, but not Attach. Which instance are these methods executed on? The attaching copy, or the persistent copy?



jdoPostAttach(java.lang.Object attached)
          This method is called during the execution of PersistenceManager.makePersistent(java.lang.Object) on the persistent instance after the copy is made.
 void jdoPreAttach()
          This method is called during the execution of PersistenceManager.makePersistent(java.lang.Object) on the detached instance before the copy is made.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Craig Russell added a comment - 04/Jun/06 12:13 AM
The AttachCallback methods are called during makePersistent if there is a detached instance among the reachable instances of the parameter to makePersistent.

During makePersistent on a detached instance, a persistent copy of the detached instance is made (or an existing persistent instance in the cache with the same object identity is located).

Thus, there are two distinct instances: the detached instance; and the corresponding persistent instance.

The jdoPreAttach method is invoked on the detached instance.

The jdoPostAttach method is invoked on the persistent instance, with the detached instance as the parameter.


Dave added a comment - 14/Oct/06 02:45 AM

   [[ Old comment, sent by email on Tue, 6 Jun 2006 09:38:41 -0600 ]]

Craig,

I think you missed the point of this bug report.
Your explanation below makes since and explains what is going on.

My point is that the JavaDoc documentation of these methods is confusing.

During attachment, the state of "the copy" that was previously detached is
synchronized with the original object and ultimately the with the
datastore.

Instead of "after/before the copy is made", it should say something like:
"after/before the detached object's state is transfered to the persistent
object's state".

upon whether the original persistent object instance is still in memory.



On 6/3/06, Craig Russell (JIRA) <jira@apache.org> wrote: