Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 89698 invoked from network); 11 Oct 2004 23:35:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Oct 2004 23:35:18 -0000 Received: (qmail 1960 invoked by uid 500); 11 Oct 2004 23:35:17 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 1829 invoked by uid 500); 11 Oct 2004 23:35:15 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 1814 invoked by uid 99); 11 Oct 2004 23:35:15 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [204.146.167.214] (HELO Boron.MeepZor.Com) (204.146.167.214) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 11 Oct 2004 16:35:13 -0700 Received: from [9.72.133.66] (dmz-firewall [206.199.198.4]) by Boron.MeepZor.Com (8.11.6/8.11.6) with ESMTP id i9BNZDv07074 for ; Mon, 11 Oct 2004 19:35:13 -0400 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <35B32B50-1AA6-11D9-906D-003065905854@nonintuitive.com> References: <35B32B50-1AA6-11D9-906D-003065905854@nonintuitive.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <6AEF5600-1BDE-11D9-8514-003065CBB010@nonintuitive.com> Content-Transfer-Encoding: 7bit From: Andrew McIntyre Subject: Re: Help detecting client disconnects for network server Date: Mon, 11 Oct 2004 16:36:47 -0700 To: "Derby Development" X-Mailer: Apple Mail (2.619) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Oct 10, 2004, at 3:21 AM, Samuel Andrew McIntyre wrote: > Why not just decide that 'X' (m)secs without response indicates that a > failure has occurred of enough significance to cancel a pending > transaction? To expand on this: What if the embedded instance that network server is connecting to allowed setting an upper limit on the amount of time any transaction can take? Then, when this limit is hit regardless what state server and client is in the database rolls back the transaction, and the locks are released anyway. Network server would still need to do cleanup of the client connection, but at least that would solve the problem of locks being held indefinitely. A configurable upper limit to the life of any transaction that holds a lock seems like it would be a good thing to have, even for embedded and not just for Network Server. At some point, lack of communication means that something has gone wrong, whether it is a communications or systems error, and we should probably rollback the transaction and release the locks to let processing continue. This is what DB2 for z/OS does - keep track of which threads hold locks and time them out according to an attribute of the connection: http://publib.boulder.ibm.com/infocenter/dzichelp/topic/ com.ibm.db2.doc.admin_8.1.0/bjndmstr613.htm (for z/OS, idle thread timeout parameter, note they also suggest setting your keepalive value low if you're really worried about resource consumption) Strangely, I couldn't find anything on how Oracle or DB2 UDB would handle such a situation, even regarding behavior with respect to TCP keepalive. Does anyone know how this is handled in other databases? I suppose this might be overly complicated to implement, considering what we're after, but it would address the problem. andrew