persistence@glassfish.java.net

Current fix on Issue 554 - incorrect value of EntityManager.contains() in non-tx case after query execution

From: Wonseok Kim <guruwons_at_gmail.com>
Date: Wed, 12 Apr 2006 12:11:11 +0900

Hi, persistence guys...

Today I saw the fix for issue#554 - incorrect value of
EntityManager.contains() in non-tx case after query execution.

It is fixed to return always false in non-tx, but then it could not throw
IllegalArgumentException when the argument is not entity.
Before determining whether entity managed or not, I think it should check if
the argument is valid entity.

I guess there are two solutions,
1. first check by delegate.contains(entity) and return false always.
2. always detach entities by query result, then delegate.contains(entity)
will be enough.

2 is related to the issue#552 - improve management of non-tx entity managers
within entity manager wrapper.

Thoughts?