public static final LockFile newLockFileLock(final String path)
    throws HsqlException {

        LockFile lockFile = null;

        try {
            lockFile = LockFile.newLockFile(path + ".lck");
        } catch (LockFile.BaseException e) {
            throw Error.error(ErrorCode.LOCK_FILE_ACQUISITION_FAILURE,
                              e.getMessage());
        }

        boolean locked = false;

        try {
            locked = lockFile.tryLock();
        } catch (LockFile.BaseException e) {
            throw Error.error(ErrorCode.LOCK_FILE_ACQUISITION_FAILURE,
                              e.getMessage());
        }

        // Paranoia mode: In theory, this case can't happen, given the way
        // tryLock now works; by all current understanding of the involved API
        // contracts, an exception will always be thrown instead by the code
        // above.
        if (!locked) {
            throw Error.error(ErrorCode.LOCK_FILE_ACQUISITION_FAILURE,
                              lockFile.toString());
        }

        return lockFile;
    }
public static final LockFile newLockFileLock ( final String path ) throws HsqlException { LockFile lockFile = null ; try { lockFile = LockFile . newLockFile ( path + ".lck" ) ; } catch ( LockFile . BaseException e ) { throw Error . error ( ErrorCode . LOCK_FILE_ACQUISITION_FAILURE , e . getMessage ( ) ) ; } boolean locked = false ; try { locked = lockFile . tryLock ( ) ; } catch ( LockFile . BaseException e ) { throw Error . error ( ErrorCode . LOCK_FILE_ACQUISITION_FAILURE , e . getMessage ( ) ) ; } if ( ! locked ) { throw Error . error ( ErrorCode . LOCK_FILE_ACQUISITION_FAILURE , lockFile . toString ( ) ) ; } return lockFile ; }
{@link org.hsqldb_voltpatches.persist.Logger#acquireLock(java.lang.String)}
delegate.<p>

Retrieves a new <tt>LockFile</tt> object holding a cooperative lock
condition upon the file with the given path, appended with the
extension '.lck'. <p>

@param path of the lock file, to which will be appended '.lck'
@throws org.hsqldb_voltpatches.HsqlException if the lock condition cannot
be obtained for any reason.
@return a new <tt>LockFile</tt> object holding a cooperative lock
condition upon the file with the given path, appended with the
extension '.lck'