Mailing lists / fpc-devel / 2015-04
Death of TSQLConnection instance after connection interrupt
10 messages · 2 people ·
- MMichael Van Canneyt 5
- ЧЧернов Дмитрий 5
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Чернов Дмитрий wrote 13 lines
We are aware of this problem, and we are working on a solution to be able to reconnect (so, point 4 in your list (actually, the second 3) :))
See for example: http://bugs.freepascal.org/view.php?id=26505
There is a beginning of a patch in TCustomConnection
procedure Close(ForceClose: Boolean=False);if you set Force to True then the connection will be closed and errors will be ignored.
Michael.
Чернов Дмитрий wrote 25 lines
That is because this form of close requires implementation details per descendent of TCustomconnection
It has been implemented for MySQL (where 'Server has gone away' is a frequent problem), but not yet for Firebird. I will look into it.
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.
Чернов Дмитрий wrote 14 lines
That is not possible, it would break backwards compatibility.
Michael.
Чернов Дмитрий wrote 26 lines
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.
Чернов Дмитрий wrote 11 lines
well, what I will do is try to make the reconnect work in the IBConnection.
Michael.
