Christian-

Yeah, you are hitting some of the same issues I did. There doesn't seem to 
be a straight-line path for supporting TCP connection health in a 
distributed environment. I started making some patches to improve H2's TCP 
client management.. there is still open discussion on the approach and need 
(https://github.com/h2database/h2database/pull/1990).

Q: What is the use case where you set AUTOCOMMIT=FALSE on the url?  It 
seems to me you would want AUTO_RECONNECT. 

Specifically-- would your use case instead support disabling autoCommit on 
the connection object and deal with the in doubt transactions instead?

-Matt

On Monday, September 9, 2019 at 9:39:05 AM UTC-5, Christian Buchegger wrote:
>
> Matt-
> thanks for your suggestions. Unfortunate as our application requires 
> AUTOCOMMIT=FALSE; AUTO_RECONNECT is not an option.
> Also this would just help for situations when a reconnect succeeds, and 
> still leave stale sessions.
>
> I am aware of cancel_session(). It is documented as "Cancels the currently 
> executing statement of another session." and exactly behaves as such.
> The session will still exist after using this function. 
>
> Thanks,
> Christian
>
> Am Montag, 9. September 2019 15:14:19 UTC+2 schrieb Matt Pavlovich:
>>
>> 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
>>
>>

-- 
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/4567a274-fb30-4f22-8491-8b3286ea43c0%40googlegroups.com.

Reply via email to