|
|
|
|
|
|
|
|
|
|
Re: NPE in MethodAttributeAccessor.getAttributeValueFromObject() [message #919997 is a reply to message #918928] |
Sat, 22 September 2012 16:01 |
Knut Wannheden Messages: 298 Registered: July 2009 |
Senior Member |
|
|
Hi Chris,
It seems like I will have to try to narrow this down. Yes, you are
right, the problem is occurring as part of a transaction commit. The
transaction commit is occurring since the report query is being executed
within a container-managed JTA transaction. But the only thing the
transaction does is to execute a JPQL report query as simple as:
select b.as
from b b
where b.id = :id
It seems like the query execution registers objects in the unit of work
which on commit are checked for possible changes. So I suppose a
workaround may be to call EntityManager#clear() before the transaction ends.
Regards,
--knut
On 9/21/12 15:45, Chris Delahunt wrote:
> The stack trace shows that this is occuring on a transaction commit, not
> on a query as you stated. It seems to be the same problem you originally
> posted - once your context has the problem with the embeddable, the NPE
> will occur on any flush or transaction commit.
> Since you are reusing the AId in both a collection and as A's pk class,
> are you reusing the same object in both as well? They should not be
> shared - B should have its own AId instance in its collection that is a
> different from the instance in A, even though the values held might be
> the same. Embeddable instances should not be shared, and might result in
> this exception.
>
> Best Regards,
> Chris
|
|
|
Powered by
FUDForum. Page generated in 0.04120 seconds