releaseAllLocks() when user navigate away from solution

Forum to discuss the Web client version of Servoy.

releaseAllLocks() when user navigate away from solution

Postby stefanoni » Thu Sep 30, 2010 10:54 am

The user can, at any time, navigate away from the solution, by opening a bookmark, typing a new URL etc.

How can i make sure of databaseManager.releaseAllLocks() is performed.
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: releaseAllLocks() when user navigate away from solution

Postby jcompagner » Thu Sep 30, 2010 1:08 pm

by doing that in the onsolution close
that will be called when the session times out.

there is not really another way to do it correctly over all the browsers. There is no standard function that works on all browsers that is executed when the browser window/tab is closed or a different website is loaded.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: releaseAllLocks() when user navigate away from solution

Postby stefanoni » Thu Sep 30, 2010 4:27 pm

jcompagner wrote:by doing that in the onsolution close
that will be called when the session times out.

Thanke you !

I did a test:
- start a webclient
- start a smartclient
- let them stay for one hour

but no timeout (please scroll to the right-down, to see the comments):
Prtscrn_01.jpg


did i understood something wrong ? I have nothing changed about timeout, at the server configuration.
Thanke you for any help
You do not have the required permissions to view the files attached to this post.
Last edited by stefanoni on Fri Oct 01, 2010 10:08 am, edited 1 time in total.
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: releaseAllLocks() when user navigate away from solution

Postby jcompagner » Thu Sep 30, 2010 4:36 pm

you did close the browser?

idle doesnt say we should close smart or webclients.. (smart clients dont time out anway)
that just means that the users doesnt do anything. Not that it is gone.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: releaseAllLocks() when user navigate away from solution

Postby stefanoni » Fri Oct 01, 2010 12:55 pm

jcompagner wrote:you did close the browser?

No, that was my missunderstanding. The difference (in case of webclient) between:

A: users do nothing, but solution still open/visible
- the timeout is refreshd = no timeout = never releaseAllLocks() in the onClose()

B: users moved to some other webaddress or closed the window,
- the timeout is NOT refreshed anymore = timeout after a while = onClose() performed with my releaseAllLocks()

The only thing i dont understand:
If the servoy server detect the differenc between A and B, why should i not just set the timeout to zero ?
I would be the same effect like in the smartclient (immediately onClose() performed, when close or leave happends)

Thanke you for all this newbee-help !
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: releaseAllLocks() when user navigate away from solution

Postby jcompagner » Fri Oct 01, 2010 1:01 pm

timeout to zero would be a bad idea.
But yes.. the timeout just a bit bigger as the datanotify frequency (servoy.webclient.datanotify.frequency) that you can set in the admin page. Then that would work..
But if the user has then a slight hickup and it cant for some reason send a data update for a while it will also just time out.

But i guess for normal use and in the default setting of servoy.webclient.datanotify.frequency (5 seconds) you could say i set the timout on 5x that 5 seconds so 25 seconds..

then a user will timeout in half a minute if it doesnt communicate with the server.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: releaseAllLocks() when user navigate away from solution

Postby stefanoni » Mon Oct 04, 2010 11:34 am

jcompagner wrote:But i guess for normal use and in the default setting of servoy.webclient.datanotify.frequency (5 seconds) you could say i set the timout on 5x that 5 seconds so 25 seconds..
then a user will timeout in half a minute if it doesnt communicate with the server.


Very interesting for me, because i think about to replace all my homepage stuff (xampp with php/html/javascript/mysql/flash) with Servoy. That means, in my case, that about 200 very short calls (download a pricelist, or watching for support telphone number, etc.) happens each day.

- are there any argument against the idea, to run my normal company website too, on the same server, togheter with my SaaS-Product ?
- The "timeout" we talked above meens some basicaly Tomcat Timeout Parameters ? Or can i set this "timeout" for each session programmatically ?

Thanke you for all.
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: releaseAllLocks() when user navigate away from solution

Postby jcompagner » Mon Oct 04, 2010 1:22 pm

yes a timeout we talk about is a tomcat setting, you could set that time out directly in the http session if you get a reference to it..

Your normal website, is that a servoy solution or just some other stuff like html? Tomcat can handle that also fine if needed (or an apache server in front of tomcat)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: releaseAllLocks() when user navigate away from solution

Postby stefanoni » Mon Oct 04, 2010 3:23 pm

jcompagner wrote:Your normal website, is that a servoy solution or just some other stuff like html?

My normal company stuff at the moment is apache xampp/php/html/javascript/mysql/flash and this i like to
rebuild (replace) with a servoy solution. Does this make sense, because of all the webcrawlers, 200 very short calls each day, etc. ?
They all are concurrent users, if i not care the timeout. I just like to know, if using Servoy for a Company-Homepage is used as usual.

Thanke you.
Alessandro Stefanoni ---- gigdoodle.ch ---- stefanoni.ch ----
Stefanoni Informatik Gmbh, CH-8200 Schaffhausen
Switzerland
stefanoni
 
Posts: 313
Joined: Fri Jul 23, 2010 3:17 pm
Location: Switzerland

Re: releaseAllLocks() when user navigate away from solution

Postby erikd » Tue Jan 11, 2011 6:01 am

jcompagner wrote:by doing that in the onsolution close
that will be called when the session times out.

there is not really another way to do it correctly over all the browsers. There is no standard function that works on all browsers that is executed when the browser window/tab is closed or a different website is loaded.


Johan,

But how do I even start my timer if the user doesn't log in. Our customers just start the client without logging in, then close it but it's still hanging there on the 'Clients' server page and my forceLogout() method is never triggered.

I can't start the timer in onSolutionOpen() because it's never fired!

Cheers,
Maria
erikd
 
Posts: 445
Joined: Wed Aug 11, 2010 2:32 am

Re: releaseAllLocks() when user navigate away from solution

Postby jcompagner » Tue Jan 11, 2011 10:56 am

so you mean the solution is never loaded?
You have clients on the admin page that have no solution loaded at all?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Servoy Web Client

Who is online

Users browsing this forum: No registered users and 9 guests