Forgetting to commit or rollback can lead to data inconsistencies.
When managing transactions manually, developers might forget to call commit() or rollback(), especially in error handling scenarios. This can leave the database in an inconsistent state. For example, if an error occurs during a transaction and rollback() is not called, partial updates might persist, causing data integrity issues.
Additional Notes
How would you explain a common pitfall of managing transactions manually in JDBC in an interview?