-
1. Re: Lazy loading with Rich datatable and datascroller
nbelaevski Jul 23, 2009 8:49 AM (in response to bennybottema)Hi Benny,
First let me thank you for the interesting article and blog!
Here are some comments on it:
1. It's not clear for me how can lazy-loaded list solve the LazyInitializationException problem - objects in list can contain lazy-loaded items also.
2. Here is the data model that we've created for livedemo - employs Seam and allows to do filtering/sorting just in DB. It's very easy to use: http://fisheye.jboss.org/browse/RichFaces/branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateDataModel.java?r=14764
http://fisheye.jboss.org/browse/RichFaces/branches/community/3.3.X/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/BaseModifiableHibernateDataModel.java?r=14764 -
2. Re: Lazy loading with Rich datatable and datascroller
jbalunas Jul 23, 2009 2:58 PM (in response to bennybottema)Hi Benny,
Thank you for sharing your blog and approach to this problem. I was looking at your code and you seem to be effectively skipping all lazy loading completely. You are requesting new result sets for every new page, and making another query for the data set size.
Although this may work for your situation you'll find that you are not solving the LazyInitializationException (LIE) issue, you are avoiding it by not relying on your ORM for managing your data.
This will eventually - depending on the size and scope of your application - cause the various management and performance issues that is the reason ORM was made to manage this data loading in the first place.
I would recommend as Nick has to review what Seam can do for you to avoid LIE, and get the benefits of the ORM system at the same time.