Home

LUW

LUW, short for Logical Unit of Work, is a concept used in database management to describe a sequence of operations that the database management system treats as a single, indivisible transaction. A LUW begins when a transaction is started and ends when it is either committed or rolled back. All the statements and changes performed within a LUW are part of the same logical unit.

Key characteristics of a LUW include atomicity, consistency, isolation, and durability (ACID). Atomicity ensures that either

In practice, LUWs are implemented through the database’s logging and recovery mechanisms. Changes are recorded in

A typical LUW includes multiple SQL statements, such as a fund transfer that debits one account and

all
changes
within
the
LUW
are
applied
or
none
are;
rollback
can
undo
partial
work.
Consistency
requires
that
a
LUW
moves
the
database
from
one
valid
state
to
another
valid
state.
Isolation
ensures
that
concurrent
LUWs
do
not
interfere
with
each
other,
according
to
the
configured
isolation
level.
Durability
guarantees
that
once
a
LUW
is
committed,
its
changes
survive
system
failures.
logs,
enabling
undo
and
redo
during
recovery
after
a
crash.
For
distributed
systems,
a
LUW
may
span
multiple
resource
managers
and
use
a
two-phase
commit
protocol
to
achieve
global
atomicity.
credits
another
within
the
same
LUW.
If
any
part
fails,
the
entire
LUW
is
rolled
back.
LUWs
are
distinct
from
individual
statements
and
are
defined
by
their
commit
or
rollback
boundaries
rather
than
by
a
single
SQL
command.