SA 220.127.116.1146, Delphi XE, AnyDAC DB layer
Troubleshooting an issue where I've created a simple locking scheme that is usually handled just fine by the app itself, however I did create an event (Disconnect) that should delete the lock record based on connection ID upon disconnect (the connection ID is part of the lock record, so it is a simple DELETE FROM LOCKTABLE WHERE CONNECTIONID= ? fired from the event upon disconnect).
Somehow we are getting into a state where our app goes down (not quite sure on this one yet) and those connections stay open, and the events never fire. Even a reboot of the workstation that made the original connection has no effect (thought there might be some process holding them open even though I couldn't find any even with Process Explorer (sysutils)).
So, my question is, generally speaking, should I always expect connections to be dropped (no pooling, btw) if the app that made the connection is no longer in memory (regardless of how that came to be)? Can someone explain to me how Sybase knows that it occurred and resets the connections (which is the only behavior I can reproduce...my events fire every time)? Can the server settings -tl and -ti set to zero have anything to do with it?
I do see similar postings referring to undroppable connections, but I'm not quite ready to blame the server until I have a clearer view of what I should expect from an unexpected crash.
asked 22 Aug '14, 17:03
Having -tl 0 and -ti 0 may certainly be the cause here.
If the application crashes on a Windows machine and that machine still has connectivity with the server, the Windows OS will trigger a WSAECONNRESET and SQL Anywhere will see that as a disconnect.
However, if another OS is in use, or if the machine with the crashing application's host does not have connectivity with the server (e.g. wireless connection dropped, power outage, etc.), the socket will not be cleaned up on the server.
If the socket isn't cleaned up on the server (which is very possible as -tl 0 -ti 0 instructs the server to leave it alone despite liveness and activity absence), then the disconnect event will not fire.
Hope this helps,
answered 22 Aug '14, 18:23