jcc logo            Why is NOWAIT Bad?

Question

I know it's bad for Rdb performance to use "SET TRANSACTION...NOWAIT" and that it's better to use "WAIT 1" instead. Could anyone explain why this is bad and what the effects of using NOWAIT transactions are? I've been told that if one user issue a NOWAIT transaction the performance for all users of the database degrades due to some global change of the locking protocol. Is that the case just during the lifetime of the NOWAIT transaction or is the performance affected after the NOWAIT has committed?

Answer

It isn't necessarily bad to use nowait transactions. It just means that certain optimization in the product can not be used. The optimization is carry over locks. What this does is allow you to hold locks over transactions and not have to reacquire them on the next transaction, *unless* someone else has requested access to the resource. That is exactly what a NOWAIT transaction is doing. At the granularity of the area, the NOWAIT transaction doesn't want to wait at all for locks. However when you have one optimization that tries to always hold locks and one that never waits for a lock it means that the person holding the lock will never release it and the person trying to gain access will never get access. With version 4.0 or maybe it was 3.1 there were situations where this would happen...basically NOWAIT transactions that would never obtain access to the database.

What a NOWAIT transaction has to do is 'signal' other users to demote these locks, so that they can obtain access. We do this automatically within the environment. It is the 'turning off' of the optimization that *may* be bad. The presence and absence of a NOWAITer is always recognized, so the optimization will turn itself back on.

Now if you don't use carry over locks then there is no overhead...it is an option.

 

Cheers,

-Jay Feenan
*********************************************************************
*** Jay Feenan 
*** Oracle Rdb Engineering  
***   
*** opinions expressed here are solely my own and not 
*** those of my employer. 
***  
*********************************************************************    

Copyright © 1995, JCC Consulting, Inc. All rights reserved.  Proprietary to JCC Consulting, Inc. Information retrieved from this server may be used for internal purposes only and may not be posted elsewhere without written permission.  Information accessible from this server is provided on an as-is basis. JCC exercises no editorial control over the information provided, except that written by JCC dealing with JCC services and products.  JCC and the JCC logo are trademarks of JCC Consulting, Inc.   The look of the signs or header panels is a trademark of JCC Consulting, Inc.   Oracle is a registered trademark of Oracle Corporation. ORACLE Rdb is a trademarks of Oracle Corporation.
 

Back Home Up Next

Send mail to webmaster@jcc.com with questions or comments about this web site.
Copyright © 1997-2002 JCC Consulting, Inc.
Last modified: April 21, 1999

JCC, JCC., JCC.com, jcc.com, the JCC logo, utilities, utilities., utilities.com, buyandsell, buyandsell., buyandsell.com, buyway, buyway., JCCLogLoader, JCCLoader, JCCLogMinerLoader, LogLoader, LogMinerLoader and buyway.com, are marks of JCC Consulting, Inc.

Oracle is a registered trademark of Oracle Corporation. ORACLE Rdb and LogMiner are trademarks of Oracle Corporation.   Windows NT is a trademark of Microsoft Corporation.  VMS is a trademark of Compaq Corporation.