Re: NullpointerException when accessing a lazy association after merging the object without a fetch of the lazy entities

2011-08-04 Thread Rick Curtis
I don't see any issues. Is it possible that you have a TestEntity in your DB that doesn't have any children (bad data) in your DB from a previous run? Also, why are you calling em.merge(..)? That call is unnecessary as the results from your query already are a part of your persistence context.

AW: NullpointerException when accessing a lazy association after merging the object without a fetch of the lazy entities

2011-08-04 Thread Michael Pflueger
While it should be perfectly fine if not all testentities have children (size() should just return 0), I have dropDB in my persistence.xml, so tables are dropped and recreated with every run. In this example, the call to merge() is indeed unnecessary, but in the real program I need to read a

Re: NullpointerException when accessing a lazy association after merging the object without a fetch of the lazy entities

2011-08-04 Thread Rick Curtis
While it should be perfectly fine if not all testentities have children (size() should just return 0) correct... I need another cup of coffee :) Weird that it works for you...is there anything further I can do to debug this? Agreed. For giggles, try removing the em.merge call. I seem to

AW: NullpointerException when accessing a lazy association after merging the object without a fetch of the lazy entities

2011-08-04 Thread Michael Pflueger
Hi, Agreed. For giggles, try removing the em.merge call. I seem to remember some changes being made in this area. I'm been running on trunk, but I'll try to get a 2.1.x testcase going. Well, as I said, it works without the merge, and it even works with the merge but without the merge being

Re: NullpointerException when accessing a lazy association after merging the object without a fetch of the lazy entities

2011-08-04 Thread Rick Curtis
Well I found that something was fixed in trunk that hasn't been pulled back to 2.1.x. Not sure what the change was, but that is why I couldn't recreate your testcase. Unfortunately I'm getting pulled into other things this morning and can't dig in to see what changed. Would it be possible to see