Re: Forcing lock release
Posted in 1997
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Networking & sqlhosts Configuration
Jonathan Leffler wrote:
>
> >From: trubisz@cs.sunysb.edu (Joe Trubisz)
> >Date: 21 Jul 1997 14:42:56 GMT
> >X-Informix-List-Id: <news.40674>
> >
> >Hi...
> >
> >INteresting problem: we had some ESQL/C code written which
> >was not written 'friendly', and when it crashed, it left in
> >the syslocks table a bunch of locks, which prevented subsequent
> >users from doing work.
> >
> >Is there a way for the sysadm to issue a command for force
> >the lock records to be deleted?
>
> The SysLocks table is in the SysMaster database (part of OnLine).
> Consequently, the only way that locks can be left in the table is if the
> OnLine system has not yet recognised that the client has died.
>
> I think that a shared memory connection is more vulnerable to a long delay
> between application dying and OnLine detecting this than a network
> connection is, but someone else who knows better may say otherwise.
It is not often I would disagree with JL but it I have always found that
network connections take significant longer to tidy up than SHM
connections. I the app dies then generally it is not a problem, but if
the client machine dies, the router goes down etc, then the network
connections goes to either FIN_WAIT and/or FIN_WAIT2 (netstat -a). It
can then take up to 15 minutes for the connection to time out.
>
> I don't know of a direct way of removing the locks. An indirect way might
> be to use 'onmode -z <sid>' to kill a session ID (process ID if you're
> using version 5.0x OnLine, though that can't be relevant since SysMaster
> was not available until version 6.0x).
>
> Yours,
> Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
> PS: Warning I do not reply to messages with anti-spam in the return path.
--
Paul Watson
WF Software Ltd.
Tel: +44 121 440 3179
Fax: +44 121 440 3806
Email: paulw@wfsoftware.co.uk