A system and method for managing a database is provided. The system and
method includes logic that supports an atomic synchronization operation
initiated by execution of a single synchronization statement. This
operation utilizes a single call to a database management system to
transform a database table from a first unknown state to a known state
that contains a specified target record containing one or more specified
data values. The first unknown state may be a state that already contains
the target record, or may instead be a state that does not contain the
record. In the former instance, a record containing one or more of the
data values is created, and in the latter instance, the existing record
is updated. A one-step locking mechanism is performed in conjunction with
the operation to prevent the occurrence of deadlock and to minimize the
number of required lock requests.