Re: timeout on lock feature - Mailing list pgsql-hackers

From Theo Kramer
Subject Re: timeout on lock feature
Date
Msg-id 200104180434.f3I4Ys322280@flame.co.za
Whole thread Raw
In response to Re: timeout on lock feature  (ncm@zembu.com (Nathan Myers))
List pgsql-hackers
> Timeouts are a system-level mechanism that to be useful must refer to 
> system-level events that are far above anything that PG knows about.  
> The only way PG could apply reasonable timeouts would be for the 
> application to dictate them, but the application can better implement 
> them itself.

OK we have the following scenario
 Session A                         Session B
 begin                             begin
 insert                                       -- on unique constraint
                                   insert     -- on same unique constraint
                                              -- Session A becomes idle
                                   :          -- Session B becomes ...


or we have (Informix Online)
 Session A                         Session B
 set lock mode to wait [seconds]   set lock mode to wait [seconds]
 begin                             begin    
 insert                                       -- on unique constraint
                                   insert     -- on same unique constraint
                                   * resource not available error *
                                              -- Session B carries on

Oracle 7 (OCI) has oopt() call to set wait options for requested
resources. Oracle 8 OCI has the same behaviour as PG ie. oopt() 
is no longer available.

I believe that the ability to switch the database to either not wait
for resources, or wait a specified period or wait forever 
(default) is essential especially for interactive applications.

Regards
Theo


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql problem
Next
From: Thomas Lockhart
Date:
Subject: Re: Re: No printable 7.1 docs?