Should I really go for LoadableDetachableModel ?
Hi, Please help me out here. In my web app, I have to show a list of data. Previously I was using simple arraylist in listview. To deal with any memory concern in future, I moved from arraylist to loadabledetachablemodal list. But now, in any operation like delete, update etc, whole list is being uploaded from database which is a bit time consuming. I know this is pretty obvious. So, its like i have to compromise on one issue. So what should I do? For highly traffic websites, is ldm necessary? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Should-I-really-go-for-LoadableDetachableModel-tp4651353.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Should I really go for LoadableDetachableModel ?
Probably better to use a DataView with a dataprovider for populating the list. The dataprovider has a way to create a model for each item. In that you can use a LDM for just populating one item. The dataview will only populate the dataprovider for rendering. For actions the individual LDM will be used. Martijn On Sun, Aug 19, 2012 at 9:57 AM, kshitiz k.agarw...@gmail.com wrote: Hi, Please help me out here. In my web app, I have to show a list of data. Previously I was using simple arraylist in listview. To deal with any memory concern in future, I moved from arraylist to loadabledetachablemodal list. But now, in any operation like delete, update etc, whole list is being uploaded from database which is a bit time consuming. I know this is pretty obvious. So, its like i have to compromise on one issue. So what should I do? For highly traffic websites, is ldm necessary? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Should-I-really-go-for-LoadableDetachableModel-tp4651353.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Should I really go for LoadableDetachableModel ?
Hi, Thanks for the reply. I am trying t achieve what you suggested me. But one thing I want to ask. In listDataProvider, you will anyway provide list of data to get rendered. You may render it in any manner but that list will be stored as final or class variable. Wont that take up the session ? I mean what difference will it make to use dataview instead of simple list with listview in terms of memory? I am trying to understand its concept so please ignore my mistake...:) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Should-I-really-go-for-LoadableDetachableModel-tp4651353p4651356.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Should I really go for LoadableDetachableModel ?
Hi, yes the listDataProvider doesnt help for minimize memory usage. The DataProvider will be stored in Component and therefore all fields are also stored in component/session. For e.g. 2000 Session you have 2000 times the same list in memory. This is not what you want. First optimization: Cache the list in one list (static or cacheprovider), that only one session is referenced in all dataprovider. Later optimization: dont hold a reference to the list und load the list on every request in dataprovider but with limiting the e.g. SQL-Query to the (first, count) Range given in DataProvider. The list and items will be detached on end of request (which means removed from memory) SQL-Query caching is also recommended. MySql supports this by limit . Note: Hibernate and JDO supports rangequeries DB independent. Every Request will be in Young-Gen Memory and shortly removed after requests ends. You have full controll what will stored in memory(Caches) cya Martin kshitiz schrieb: Hi, Thanks for the reply. I am trying t achieve what you suggested me. But one thing I want to ask. In listDataProvider, you will anyway provide list of data to get rendered. You may render it in any manner but that list will be stored as final or class variable. Wont that take up the session ? I mean what difference will it make to use dataview instead of simple list with listview in terms of memory? I am trying to understand its concept so please ignore my mistake...:) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Should-I-really-go-for-LoadableDetachableModel-tp4651353p4651356.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Should I really go for LoadableDetachableModel ?
Hi, Thank you for clarifying me. Removing the reference can help me out. Let me try it :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Should-I-really-go-for-LoadableDetachableModel-tp4651353p4651359.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org