home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Database / CLIPR503.W96 / NTXERR.PR_ / NTXERR.PR
Text File  |  1995-06-20  |  1KB  |  51 lines

  1. /***
  2. *
  3. *   Ntxerr.prg
  4. *   Replaceable DBFNTX error handler error handler.
  5. *
  6. *   Copyright (c) 1993, Computer Associates International, Inc.
  7. *   All rights reserved.
  8. *
  9. *   Contains the error handler for lock time-outs.  The default behavior
  10. *   is to just retry forever (backwards compatible).
  11. *
  12. *   A better behavior would be to warn the user to notify the Network 
  13. *   Administrator that some other user may have hung with an active lock
  14. *   on the index.  (Or they have it in a window that doesn't have any 
  15. *   background ticks assigned to it.)
  16. *
  17. *   Warning: changing the behavior to allow a lock to failure to be 
  18. *   ignored will produce different results depending on the operation
  19. *   that is in progress at the time the lock failed.  The index will 
  20. *   most likely be left in an invalid state and should be recreated.
  21. *
  22. */
  23.  
  24. #include "error.ch"
  25.  
  26.  
  27. ANNOUNCE _ntxerr
  28.  
  29.  
  30.  
  31. INIT PROCEDURE InitHandler()
  32.    LOCAL bDefError
  33.  
  34.     bDefError := ErrorBlock( { |err| LockErrHandler( err, bDefError ) } )
  35.  
  36.    return
  37.  
  38.     
  39.  
  40. STATIC FUNCTION LockErrHandler( oErr, bDefError )
  41.  
  42.    if ( oErr:genCode == EG_LOCK )
  43.    
  44.       return ( .T. )
  45.  
  46.     end
  47.  
  48.    return ( eval( bDefError, oErr ) )  // chain back to default error handler
  49.         
  50.