Good point, I agree.
Could you create a Jira issue and a patch against 1.2 branch
(unaffected by the current Maven migration), and then port it to HEAD
when the migration is over?
Also would be nice to create a unit test showing the problem, just to
make sure that the fix fixes it (Util.cloneViaSerialization can help
in serialization testing).
Andrus
On Jul 27, 2006, at 1:50 PM, Mike Kienenberger wrote:
> On 7/26/06, Mike Kienenberger <mkienen..mail.com> wrote:
>> And with the changes to ToManyList, I've now been able to see that
>> removedFromUnresolved contains a reference to my deleted object.
>
> I'm now thinking that the solution to this problem is to not add NEW
> or TRANSIENT objects to the removedFromUnresolved list. These
> objects will never be removed from a database fetch list as they don't
> exist in the database, so there's no point in keeping a reference to
> them.
>
> boolean removeLocal(Object object) {
> if (addedToUnresolved != null) {
> addedToUnresolved.remove(object);
> }
>
> if (removedFromUnresolved == null) {
> removedFromUnresolved = new LinkedList();
> }
>
> // No point in adding a new or transient object -- these will
> never be fetched from the database.
> boolean shouldAddToRemovedFromUnresolvedList = true;
> if (object instanceof DataObject) {
> DataObject dataObject = (DataObject) object;
> if ( (dataObject.getPersistenceState() ==
> PersistenceState.TRANSIENT)
> || (dataObject.getPersistenceState() ==
> PersistenceState.NEW) ) {
> shouldAddToRemovedFromUnresolvedList = false;
> }
> }
>
> if (shouldAddToRemovedFromUnresolvedList) {
> removedFromUnresolved.addLast(object);
> }
>
> // this is really meaningless, since we don't know
> // if an object was present in the list
> return true;
> }
>
This archive was generated by hypermail 2.0.0 : Thu Jul 27 2006 - 22:32:38 EDT