Caching is definitely possible. But during onActivate() we cannot reliably
determine whether it was caused by autocomplete event (thus we can use
cached data), or it was caused by any other event (in which case we can't
use cached data).

So separating suggestions data source completely from the page would be an
optimal solution, but it cannot be done without completely re-writing logic
of the component, to make it possible to request an arbitrary event link
instead of event link within current page scope.



On Fri, May 16, 2014 at 2:02 AM, John <j...@quivinco.com> wrote:

> Could you cache your hibernate results for subsequent calls?
>   ----- Original Message -----
>   From: Ilya Obshadko
>   To: Tapestry users
>   Sent: Thursday, May 08, 2014 1:33 PM
>   Subject: autocomplete data source
>
>
>   It turns out that running an event handler (onProvideCompletionsFromXXXX)
>   in the same component/page may result in various race condition problems.
>
>   Suppose you have a complex form and data initialization occurs during
>   onActivate phase. Then, this initialization is going to happen every time
>   onProvideCompletions handler is called. If this initialization involves
> for
>   example Hibernate objects loading, in several situations I get 'session
> is
>   closed' errors (in fact this is very unpredictable - the same operation
>   under same conditions may either work normally or fail).
>
>   Are there any suggested methods to make autocomplete data source totally
>   independent from current component?
>
>   --
>   Ilya Obshadko
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>



-- 
Ilya Obshadko

Reply via email to