[fpc-devel] Death of TSQLConnection instance after connection interrupt

Michael Van Canneyt michael at freepascal.org
Fri Apr 17 16:39:32 CEST 2015



On Sat, 18 Apr 2015, Чернов Дмитрий wrote:

> 
> 18.04.2015, 00:00, "Michael Van Canneyt" <michael at freepascal.org>:
>
>        On Fri, 17 Apr 2015, Чернов Дмитрий wrote:
>               17.04.2015, 20:36, "Michael Van Canneyt" <michael at freepascal.org>:
>
>                      On Fri, 17 Apr 2015, Чернов Дмитрий wrote:
>                             also one small question. will it be possibly to determine whether connection was closed by user or interrupted? and what about events
>             calling on
>                           interrupts?
>
>                      We can think about this. The problem with an interrupt is that you don't know when it happens.
>                      You only see it when you try to do something new.
>
>                      Michael.
>
>               I believe that additional boolean argument for BeforeDisconnection event, that will show us if disconnection was caused by interrupt, could be nice
>             solution.
>
>        That is not possible, it would break backwards compatibility.
>
>        Michael.
> 
>  
> oh, i'm sorry. forgot about it.
> maybe then it's better to add OnInterrupt event?

When do you want to call such a hypothetical event ? 
As I said, there is no good way to detect when it happens:

Only when you do a new operation and the call returns an error, 
you will know after examining the exact error (which is an unsure operation) if it was 'interrupted'.

Michael.


More information about the fpc-devel mailing list