There are two situations in which a connection can be: either in auto-commit mode or not in auto-commit mode (by calling Connection#setAutoCommit(false) ).
In the first case, when executing a package of SQL update commands, partial execution of commands can be executed, that is, some commands can be executed, while others have not been executed yet. See this quote from the documentation of Statement#executeBatch() :
If one of the batch update commands does not work properly, this method throws a BatchUpdateException , and the JDBC driver may or may not continue to process the remaining commands in the batch. However, the driver behavior must correspond to a specific DBMS, either always continuing to process commands, or never continue to process commands.
If the connection is not performed in the automatic commit mode, then only when the Connection#commit call returns, we can assume that all the sent commands are committed. After this call, all or all are committed.
manouti
source share