Apache JDO Project - Re: 2.1 Spec: detached-dirty parameters to makePersistent() when DetachAllOnCommit=tru

This is Interesting: Free IT Magazines  
Home > Archive > Apache JDO Project > August 2007 > Re: 2.1 Spec: detached-dirty parameters to makePersistent() when DetachAllOnCommit=tru





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: 2.1 Spec: detached-dirty parameters to makePersistent() when DetachAllOnCommit=tru
Andy Jefferson

2007-08-09, 7:11 am

Hi,

>
> Sounds great to me. There's some fine print here, though: Just
> because CopyOnMakePersistent is set to true, that doesn't mean that
> makePersistent() will *always* return copies. For example, current
> specified behavior says that when DetachAllOnCommit=3Dfalse and calling
> makePersistent() with a transient parameter, the returned object will
> be the same instance, now transitioned to persistent-clean. This
> behavior won't change because of our new option (regardless of
> whether it is set to true or false), and we don't want folks to be
> confused about that...


I prefer the name you suggested to the one I originally wrote. Comments :-

1. "DetachAllOnCommit" has no bearing on what makePersistent() does - it=20
defines what happens on tx.commit() only. makePersistent will (currently)=20
return the original object if persisting a transient and return a copy if=20
attaching.

2. How about calling it CopyOnAttach ? makePersistent has two roles ...=20
persisting new, and attaching detached. I don't ever see a need to add=20
control to the operation of persisting a new object, so the=20
name "CopyOnAttach" distinguishes to just the attach process.




=2D-=20
Andy =A0(Java Persistent Objects - http://www.jpox.org)

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com