Christian-

Look into setting these combinations:

1. On the server: h2.socketConnectTimeout
2. On the client urls: ;AUTO_RECONNECT=TRUE

The behavior will be that clients re-connect over and over (harmless, but 
not ideal) but you won’t have stale connections or abandoned locks. 

Also note— there already exists a function to close sessions:

http://www.h2database.com/html/functions.html#cancel_session

-Matt

On Monday, September 9, 2019 at 6:47:20 AM UTC-5, Christian Buchegger wrote:
>
>
> With our application using h2(1.4.199) as database in server mode, we see 
> stale sessions and sometime they hold locks.
>
>
> We understand the cause for this behavior and can reproduce it. 
> Application users are hopping with their notebooks between meeting rooms, 
> loose their connections and eventually get assigned new IP addresses in 
> another network.
>
>
> While the keep-alive feature discussed in 
> https://github.com/h2database/h2database/issues/2032 may mitigate this to 
> some extend, we possibly need further functionality to have more control.
>
>
> I would like to get feedback on the below two proposals:
>
>    1. Add a function abort_session:
>    Abort current command and call session.close() so that the locks and 
>    resources will be released. This will avoid the need of server restart.
>    2. Add a parameter SQL_SESSION_IDLE_TIMEOUT
>    With this parameter, a session will be closed by the server, when 
>    there was no client activity within the defined timeout period.
>
>
> Please provide your view regarding:
>
>    - Do you see this behavior as well?
>    - If yes, how do you handle this?
>    - Would you benefit from the proposed features, so that it would make 
>    sense to pursue this ?
>
>
> Thanks,
> Christian
>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/0976ef09-eb7d-4c6e-8df4-72fbc4865dae%40googlegroups.com.

Reply via email to