Many articles and documents says that by setting Auto Commit off, You can start a transaction in JDBC. This Topic also ask same question but It doesn't answer to the question and just said:
Changing the auto-commit mode triggers a commit of the current transaction (if one is active).
Ok. but next?
for finding an answer, I searched and found this:
- Autocommit transactions:
Each individual statement is a transaction.
- Explicit transactions:
Each transaction is explicitly started with the BEGIN TRANSACTION statement and explicitly ended with a COMMIT or ROLLBACK statement.
- Implicit transactions:
A new transaction is implicitly started when the prior transaction completes, but each transaction is explicitly completed with a COMMIT or ROLLBACK statement.
And then I found this:
Committing Transactions
After the auto-commit mode is disabled, no SQL statements are committed until you call the method commit explicitly. All statements executed after the previous call to the method
commit
are included in the current transaction and committed together as a unit.
Therefore I conclude that after the auto-commit mode is disabled, we are in Implicit mode and we also know that for disabling auto-commit, a COMMIT statement has been run so after setting the Auto-commit off, we've started a new transaction.
Can we draw such a conclusion based on these cases? is it a right conclusion?