persistence@glassfish.java.net

Re: Trying to connect to Remote ession Bean from JSF backing bean

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Tue, 21 Nov 2006 00:32:32 -0800

Hi Wouter,

Explicit or implicit type of LAZY causes the problem as it results in class
modifications by TopLink Essentials to support the lazy load (the runtime
needs to be notified that it's time to load the field as it's been accessed).

If fetch type EAGER solves your problem, you don't need to worry about anything
else. Otherwise you might need to do static weaving of your client side entity
classes before packaging.

regards,
-marina

Wouter van Reeven wrote:
> Hi Marina,
>
> On Mon, Nov 20, 2006 at 11:56:57PM -0800, Marina Vatkina wrote:
>
>>This seems like the problem discussed on the users_at_glassfish thread to
>>which I replied today:
>>https://glassfish.dev.java.net/servlets/ReadMsg?list=users&msgNo=1452
>>
>>Does it make sense? OneToMany side of the relationship defaults to
>>the fetch type LAZY.
>
>
> Thanks for your reply. I saw your reply on the users_at_glassfish list, but I
> didn't connect it to my problem.
> I think your explanation does make sense. Would this mean that making the fetch
> type (be it eager or lazy) explicit, the ClassCastException shouldn't happen? I
> figure that in that case Toplink won't have to modify the class.
>
> When I set it explicitly to eager I don't get any errors but I figured that was
> because all rows were fetched and transfered to my client. The client, by the
> way, is NOT a Java EE Client so that may explain me getting the error.
>
> I will explicitly set the fetch type to lazy and see if I still don't get any
> errors.
>
>
> Thanks! Wouter
>