You can't just set all of your collections to be eagerly loaded, that is most definitely *not* the solution...and is in 99% of cases, a bad idea.  You're better off doing separate queries for the exact data you need as opposed to eagerly-loading everything + the kitchen sink.  You can only eagerly load one collection per entity anyhow...and cannot nest them in child entities...or the latest JBoss EJB3 implementation will barf while deploying your app.

We're getting somewhat off-topic here, however and we should focus on a Wicket-specific solution to rival Seam's ability to make transparent access to lazily-loaded collections for JSF.

On Thu, 2006-06-01 at 13:00 +0200, Ricky wrote:
I want to add some thoughts about how NOT to do it. Its for completeness  
sake.

>     @entiy
>      class BeanB ...
>           private BeanA;
>           @ManyToOne(fetch=FetchType.LAZY)
>           public BeanA getBeanA()

I solved the problem with fetch=FetchType.EAGER. This has a serious impact  
on performance but it will get you going.

>     c) never do a direct access. Always send the bean back to the server  
> and do the loading on the server

I dont know exactly what you mean with this.

In our setup we had value objects guarding the beans. Again, this is the  
way not to do it. We "designed" for EJB 2.1 and introduced value objects  
to pass information in and out of beans. Then the client wanted cutting  
egde EJB 3.0 with an old buggy jboss version. In the end we had (EJB 3.0)  
stateless beans which used entity beans which returned value objects. So  
we did not passed the entity bean POJOs but some VOs.

Again, dont try this at home. Its for your interest and hopefully for your  
amusement.

Ricky

PS
Its interesting: I changed nearly all eager statements to lazy statements  
to evaluate the problem again but its simply working now. I am not sure  
why or if the situation is not compatible with the given scenario but my  
application throws no exceptions...


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to