From bfa452a375ea0a0a3f95304a69186936567e5263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 14 Aug 2023 19:45:36 +0200 Subject: New upstream version 4.1.4 --- docs/html/xbc12.html | 86 ---------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100755 docs/html/xbc12.html (limited to 'docs/html/xbc12.html') diff --git a/docs/html/xbc12.html b/docs/html/xbc12.html deleted file mode 100755 index a40c7e0..0000000 --- a/docs/html/xbc12.html +++ /dev/null @@ -1,86 +0,0 @@ - - -Xbase DBMS Chapter 12 - -

Record and File Locking

-

Chapter Updated 12/13/22


- -

Locking Overview

- -Xbase64 supports multi-user processing through file and record locks. -Record locking restricts multiple cooperating programs from simultaneously -accessing the same data and corrupting it. Without record and file locking -in a multi-user environment, simultaneous access to the data and index files -can cause the files to become inaccurate and unusable.

- -Automatic record locking is on by default in the Xbase64 library. To disable it, -use method xbXBase::DisableDefaultAutoLock() and to enable it, use method xbXBase::EnableDefaultAutoLock(). -

-Locking can also be enabled / disabled at the table level with with xbDbf::SetAutoLock().

-If autolocking is disabled and the code base is being used in a multi user environment, it is -up to the application program to verify the needed locks are set as there is no checking or -setting any locks if autolocking is turned off. It is only safe to turn off the autolocking functionality -if the library is being used in a single user environment. - -

-The current Xbase64 record locking logic is modeled after DBase (tm) V7 locking. -

- -The locking methods return either XB_LOCK_FAILED or XB_NO_ERROR. If they return -XB_LOCK_FAILED the actual reason can be found in the global variable -errno or function perror() can be executed to view the -results. -

- -The errno field may contain one of the following values if the lock was not -successful.

- - -
Error CodeDescription -
EBADFInvalid file descriptor -
EINVALInvalid lock information or file does not support locks -
EACCESS
EAGAIN
Lock can not be set because it is blocked by an existing lock on the file. -
ENOLCKThe system is out of lock resources, too many file locks in place. -
EDEADLKDeadlock condition -
EINTRProcess was interrupted by a signal while it was waiting -
-

- -

Linux/Windows File Locking Compatibility Issue

- -There is a compatibility locking issue to be aware of. Windows environments allow for the exclusive -opening of file handles and Linux/Unix platforms do not. If you are writing an application that will be -using a tool like Dbase on a Windows machine, accessing a file on a Linux/Samba configure machine, -be aware that the file could be opened in exclusive mode by DBase on the Windows system, and the same file could -be simultaneously opened with a program on the Unix box. That could cause some issues. - -

-In Unix, a program can not lock a file so another process can not access it.
-In Windows, a program can lock a file so another process can not access it.
-DBase(tm) supports routines to open files exclusively, preventing other users from opening a file.
-Locking on the Mac/Apple platform only works on NFS shares. It does not work with SMB shares. - -

Samba settings

- -If you will be using Samba on Linux/Unix and sharing files between Linux and Windows machines, -you will need to disable oplocks. In the smb.conf file, set:
-
-[sharename]
-oplocks = False
-level2 oplocks = False - - -

iLockFlavor

- -The library was constructed in a manner so that it could be updated to support alternate lock "flavors". -The 4.x.x library is built to mirror the DBase locking, but the structure is in place to expand to other locking -types if needed. - - - - -


-

-



- - -- cgit v1.2.3