Back to Databases FAQs
HELP CENTER · FAQDatabases1 min read

Why can a long-running database transaction cause problems?

A transaction left open too long can retain locks or old row versions, delay cleanup, and increase contention. The impact depends on the database engine and workload, so find out why it remains open before changing isolation or timeouts.

Databases

Find the transaction's wait and lifetime

Inspect active transaction age, current query, session owner, and lock waits using supported monitoring tools. A transaction may be waiting on application input or network I/O rather than actively using the database.

Large batch work and user interactions should usually be split into shorter units when business rules allow. Holding a transaction open while a person reviews a screen can block writes or preserve obsolete versions longer than needed.

Reduce impact safely

Commit or roll back only after confirming operation state and recovery requirements; killing a session can leave application work incomplete. Use bounded timeouts where appropriate and make error handling explicit.

Monitor transaction age and lock duration, then optimize the query or workflow causing the long hold. Do not split a required atomic operation without accounting for partial completion and consistency.

Back to Databases FAQs