Skip to content

Enabling autoCommit against server without active transaction throws an error #3473

@ScottDugas

Description

@ScottDugas

If you enable autoCommit against a server without an active transaction, it will fail, e.g.:

connection.setAutoCommit(false);
connection.setAutoCommit(true);

throws: Transaction was not initialized

connection.setAutoCommit(false);
// do something in the transaction
connection.commit();
connection.setAutoCommit(true);

throws: No transaction to commit

connection.setAutoCommit(false);
// do something in the transaction
connection.rollback();
connection.setAutoCommit(true);

throws: No transaction to commit

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions