Thank you Olaf and Michael. I think this is workable... We can create an abstract base class that instead of doing load() directly, the signature would be something like:
public Future<T> load(ExecutorService executor); The async load() will execute immediately upon model creation, and during the "actual" LoadableDetachableModel.load(), it will simply wait for the future to complete (if it hasn't completed). Since there can be multiple futures executing at one time, no model is blocked by the loading of another model. That's in theory... Hopefully it will actually work as intended. :) Is there a plan to make this asynchronous model support built-in in Wicket? With asynchronous frameworks like Play and vert.x, I think Wicket needs to improve on this front too to keep itself relevant. If anyone else also have a need for this (at least there are 3 of us) I can file a ticket. Hendy On Tue, Dec 25, 2012 at 6:49 PM, michael mosmann [via Apache Wicket] < ml-node+s1842946n4655050...@n4.nabble.com> wrote: > If you want to speedup thing, you should trigger some model loading as > early as possible.. (It is too late, if a component calls > IModel.getObject() (should return the right value)). Because wicket uses > one thread per request you must use an other thread for loading. > > This way you could speedup a pageload for one user.. but not for more > than one (you have to load it anyway) .. there is a good chance to make it > worse. I think you choose a threaded model loading if most other options > failed (use a cache, change the query, ...) > > Mm:) > > > > > Hendy Irawan <[hidden > email]<http://user/SendEmail.jtp?type=node&node=4655050&i=0>> > schrieb: > > > > >Hi friends, > > > >If I have 5 Wicket (LoadableDetachable)models on a page, will Wicket > >load > >each model sequentially, or will the 5 models loaded concurrently ? > > > >We're using different servers for each database connection (MongoDB, > >Neo4j, > >etc.) so it will be a more effective use to load the models > >concurrently. > > > >Thank you. > > > > > > > >-- > >View this message in context: > > > http://apache-wicket.1842946.n4.nabble.com/Are-Wicket-models-loaded-concurrently-tp4655046p4655047.html > >Sent from the Users forum mailing list archive at Nabble.com. > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [hidden > >email]<http://user/SendEmail.jtp?type=node&node=4655050&i=1> > >For additional commands, e-mail: [hidden > >email]<http://user/SendEmail.jtp?type=node&node=4655050&i=2> > > -- > Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail > gesendet. > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://apache-wicket.1842946.n4.nabble.com/Are-Wicket-models-loaded-concurrently-tp4655046p4655050.html > To unsubscribe from Are Wicket models loaded concurrently ?, click > here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4655046&code=aGVuZHlAc29sdXZhcy5jb218NDY1NTA0NnwxNTI0Njc4NzUy> > . > NAML<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- Hendy Irawan - on Twitter <http://twitter.com/hendybippo> - on LinkedIn<http://id.linkedin.com/in/hendyirawan> Web Developer | Bippo Indonesia <http://www.bippo.co.id/> | Akselerator Bisnis | Bandung -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Are-Wicket-models-loaded-concurrently-tp4655046p4655051.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