Skip to content
Sharp

SQL for Java Devs · interview question

Why is it important to disable auto-commit mode for a JDBC transaction when performing multiple updates?

Multiple choiceEasychapter-8-curatedpremiumsql-for-java-devstransactions
Choose one answer
Answer and explanation

Correct answer

D. To allow rollback of all updates if one fails

Why

Disabling auto-commit mode allows you to treat multiple operations as a single transaction. This is crucial for maintaining atomicity, as it allows rolling back all changes if any operation fails, ensuring data consistency.

Test yourself on SQL for Java Devs

A free test with instant, explained results. No account needed.

Start free test
All SQL for Java Devs questions →