08-09-07 12:11 PM
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)
[ Post a follow-up to this message ]
|