Wicket + JPA lazy-loading

2012-03-18 Thread Bálint Kriván
Hey!

It seems that when wicket is trying to serialize the persistent objects
(probably to session) the lazy loading kicks in and it retrieves the whole
graph.
Not sure if wicket is using the default java serialization or a special
one, but is there anybody else who is/were experiencing the same? By any
chance would you have any suggestion how can I overcome this?
It would be a great solution if an association is persisted when it's
loaded, but if it isn't then do not lazy load it, just leave it null.

Thanks!

Regards,
Bálint Kriván


Re: Wicket + JPA lazy-loading

2012-03-18 Thread Bálint Kriván
I don't want to serialize them but wicket does (I have a list of objects
which I pass to a ListView).
IIRC, If I use LDM I can make wicket to serialize only an ID and when it is
readed back I can reach the backend to get the correct object for that ID.
If I would switch to this probably it would be more query than now, because
even the parent objects should be retrieved from the DB one-by-one.
It would be enough for me if I could make wicket not to try to serialize
these objects (these are retrieved in the constructor so I don't see the
need to save them on the first place)

On Sun, Mar 18, 2012 at 1:56 PM, James Carman ja...@carmanconsulting.comwrote:

 Use a LoadableDetachableModel.  You shouldn't be serializing
 persistent objects (unless of course you're in the middle of editing
 them or something).

 On Sun, Mar 18, 2012 at 8:36 AM, Bálint Kriván bal...@krivan.hu wrote:
  Hey!
 
  It seems that when wicket is trying to serialize the persistent objects
  (probably to session) the lazy loading kicks in and it retrieves the
 whole
  graph.
  Not sure if wicket is using the default java serialization or a special
  one, but is there anybody else who is/were experiencing the same? By any
  chance would you have any suggestion how can I overcome this?
  It would be a great solution if an association is persisted when it's
  loaded, but if it isn't then do not lazy load it, just leave it null.
 
  Thanks!
 
  Regards,
  Bálint Kriván

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Üdv,
Kriván Bálint