On 7/20/07, Allen Gilliland <[EMAIL PROTECTED]> wrote:
1. having JPA complain about using an object after it is removed seems a
bit ridiculous.  There are very valid reasons to do this, such as the
example below.  If you really can't work around this then we should plan
to change the various removeXXX() methods to return a safe copy of the
deleted object that can continue to be used.

JPA did not complain, but it did set fields of the object to null and
the result was an NPE in the invalidate method. I think its debatable
whether an object should continue to be valid after it is
removed/deleted/whatever.


2. moving the invalidation call before the removal is technically
incorrect because then if there is an error during the removal you've
mistakenly invalidated the template.  while this isn't a huge problem in
this particular situation it's still not a proper solution and i am
guessing that there is somewhere else in the code where doing the same
thing could cause more problems.

Yes. I think it's pretty safe to say that the JPA code needs more testing.

- Dave

Reply via email to