Results 1 to 5 of 5
  1. #1
    Join Date
    May 2006
    Location
    Barcelona, Catalonia, Spain
    Posts
    3

    Question Unanswered: How to release locks held by dead sessions

    Hello to all forum members.

    I'm new as forum member, although I've been reading your posts for a long time and I've found a lot of usefull info on them. But this time, I have a question that I haven't been able to find anywhere. So let's start with it...

    The simple question is:
    How can I have IDS (9.x or higher) to AUTOMATICALLY release dead (or long inactive) sessions?


    I explain it a little bit more:
    • I have an application connecting through ODBC (Informix ODBC Runtime 3.81) and in the middle of the current transaction the connection with IDS is lost (i.e. phyiscally lost) for a while.
    • When the application detects that connection is lost, it retries reconnecting periodically until it finally establishes a new connection (for instance, once the physical connection problem has been solved).
    • Then, it restarts the work and opens a transaction to perform the same actions (inserts and updates) that it was doing when the previous transaction was interrupted.
    • At this point, it finds that the resources to update are being locked by the old session it had opened, which is still "alive" in the server side, so the work is stopped... for an indefinite time.


    The same problem occurs when the application is killed or abnormally terminated (client machine falls), instead of just losing connection, and a new application instance must be started.

    I would like to have IDS killing those "long inactive" sessions automatically after a given timeout or something like this.

    How has this problem been solved by Informix?

    Thanks a lot in advance.

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    780
    Hola,

    Para este tema debes tener en cuenta algo importante que es el manejo de concurrencia de usuarios y los lockeos. Si tienes una gran concurrencia de usuarios te conviene tener el modo de lockeo de las tablas por "fila", en lugar del default, por "página".
    La otra cosa que puedes hacer es manejar el tiempo de cada conexión, con el "keep-alive" de TCP/IP. Esto es un valor en el quinto campo del archivo onconfig. Por default no viene definido y generalmente es de una hora. Esto significa que si una sesión muere, quedará este período de tiempo hasta que el sistema operativo la haga desaparecer.
    Espero te sirva.

    Gustavo.

  3. #3
    Join Date
    May 2006
    Location
    Barcelona, Catalonia, Spain
    Posts
    3
    Hola Gustavo,

    Muchas gracias por tu temprana respuesta!

    Quote Originally Posted by gurey
    Si tienes una gran concurrencia de usuarios te conviene tener el modo de lockeo de las tablas por "fila", en lugar del default, por "página".
    Ya los tengo puesto por "fila", pero en el caso que me ocupa esto no evita el problema.

    Quote Originally Posted by gurey
    La otra cosa que puedes hacer es manejar el tiempo de cada conexión, con el "keep-alive" de TCP/IP. Esto es un valor en el quinto campo del archivo onconfig. Por default no viene definido y generalmente es de una hora. Esto significa que si una sesión muere, quedará este período de tiempo hasta que el sistema operativo la haga desaparecer.
    Es justamente lo que andaba buscando!

    Pero no tengo claro a qué parámetro del onconfig te refieres. ¿Es este?
    NETTYPE onsoctcp,30,,NET # Override sqlhosts nettype parameters

    ¿Te refieres a añadir un quinto parámetro detrás de "NET"?

  4. #4
    Join Date
    Apr 2004
    Location
    Brussels
    Posts
    57
    I don't read Spanish,
    maybe this can help :

    Look at your keep aliovce option in sqlhosts file.
    k=0 disable the keep-alive feature
    k=1 enable the keep-alive feature
    the keep-alive feature is enabled by default.

    and check with the keep-alive of your tcpip stack

    From admin guide :
    When a connected client and server are not exchanging data, the keep-alive option enables the network service to check the connection periodically. If the receiving end of the connection does not respond within the time specified by the parameters of your operating system, the connection is considered broken, and all resources related to the connection are released.

    success
    Yves & Willy

  5. #5
    Join Date
    May 2006
    Location
    Barcelona, Catalonia, Spain
    Posts
    3
    Thanks a lot, supinformix.

    I've followed your advice and looked at the Admin Guide. I've seen that this parameter is enabled by default and works with the TCP/IP keep-alive interval, so I've changed it to 10 minutes (from the 2 hours default value) and this works fine!!

    That's exactly what I was looking for. The incredible thing is that I searched for this issue in Informix documentation center and all around the web and was unable to find it. Now I see it: the key words are "keep-alive". That's all.

    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •