Browse Prior Art Database

Method to Ensure the Integrity of File Operations in a Database Transaction

IP.com Disclosure Number: IPCOM000116028D
Original Publication Date: 1995-Jul-01
Included in the Prior Art Database: 2005-Mar-30
Document File: 4 page(s) / 149K

Publishing Venue

IBM

Related People

He, Q: AUTHOR [+4]

Abstract

Disclosed is a method which ensures the integrity of data stored in a file system and data in a database during a transaction. This method can be characterized as follows: o tem A series of file operations are unified into a job in the same way as database operations during a transaction. o tem Each unit of work holds lock on relevant files during a transaction easily by using lock facilities of a database.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 35% of the total text.

Method to Ensure the Integrity of File Operations in a Database Transaction

      Disclosed is a method which ensures the integrity of data
stored in a file system and data in a database during a transaction.
This method can be characterized as follows:
  o  tem A series of file operations are unified into a job in the
      same way as database operations during a transaction.
  o  tem Each unit of work holds lock on relevant files during a
      transaction easily by using lock facilities of a database.

      In order to provide these facilities, a transaction manager
that controls both file operations and database operations is
necessary.  The transaction manager tracks file operations within a
unit of work and keeps those files in a consistent state.

      Any application that requires file operations to be unified
into a single job starts a unit of work by issuing a TRANSACTION
START command.  The application must end the unit of work by issuing
a COMMIT or ROLLBACK command.  Any reading or writing of files is
done within the unit of work.

      The COMMIT command makes all the changes within the unit of
work permanent, while the ROLLBACK removes all the changes from the
file system and the database.  The transaction manager imposes locks
on files to prohibit applications from accessing uncommitted files
written by other applications, thus ensuring data integrity.  The
transaction manager acquires locks implicitly and frees them when a
unit of work is ended by a COMMIT or ROLLBACK command.  The disclosed
method utilizes the locking facilities of database managers to
realize locking for file operations easily.

      The primitives for realizing this method are as follows.  Any
application must use these primitives to ensure the integrity of file
operations.  The behaviors of each primitive is also explained in the
following descriptions.
  o  Starting a Transaction
     1.  A unique Transaction ID (TID) is generated.
     2.  A database connection is established and a database
          transaction is started.
     3.  The file operation log is initialized.
     To realize a simple locking mechanism for file operations, each
      database is assigned a file repository, that is, a directory in
a
      file system.  Any file operation in the directory must be
      synchronized with operations in the database.
  o  Creating a File
     1.  File name information is inserted into the connected
          database.
     2.  A file that has a unique name generated from the given file
          name and the TID is created.
     3.  A WRITE log for the file is added in the file operation log.

    Assume that an application is creating a file named "myfile1".
First, the transaction manager inserts into the connected database
data
containing enough information to allow the file to be identified; for
example, "myfile1"....