cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Keeping hessian servlet session active with a rop client
Date Tue, 14 Sep 2010 14:24:46 GMT
Nothing that is built in for this purpose, and IIRC that 'getEntityResolver' approach may no
longer work, as we are caching it now on the client. You can issue a simple query instead
I guess. Something that executes quickly and doesn't bring back any data. It may even end
up having better performance than 'getEntityResolver'. 

Also I am thinking we should look at adding a seamless reconnect ability to the Hessian transport.
As in most cases users won't maintain server-side state between requests, so abandoning a
session and creating a new one shouldn't be a big deal if that's transparent to the users.

Andrus


On Sep 14, 2010, at 7:34 AM, emanuele@mengozzi.com wrote:

> I've a swing application using cayenne ROP, i had problem with session
> timeout of the hessian servlet, so far in order to avoid long session
> timeout, i implemented a thread preforming the following:
>   ....
> 
>    DataChannel channel;
>   ....
> 
>    public void run() {
> 
> 
> 
> 
>        for(;;)
>        {
> 
>            this.channel.getEntityResolver();
> 
>            try {
>                Thread.sleep(120000);
>            } catch (InterruptedException ex) {
>                Logger.getLogger(Instance.class.getName()).log(Level.SEVERE,
> null, ex);
>            }
>        }
>    }
> 
> it issue a bootstrap message every 12 seconds.
> 
> 
> I didn't find a better way to doit, using cayenne 2.
> 
> I wonder, since im planning to switch the application to cayenne 3, for
> both Nested Context and Paginated queries for ROP, is there a better way
> to "ping" Hessian servlet to keep session active?
> 
> 
> 
> 
> 
> 


Mime
View raw message