@WrRan
2016-11-17T09:30:58.000000Z
字数 872
阅读 1232
node-oracledb
By default,
DML
statements are not committed in node-oracledb.
The node-oracledb add-on implements commit()
and
rollback()
methods that can be used to explicitly
control transactions.
If the autoCommit
flag is set to true,
then a commit occurs at the end of each execute()
call. Unlike an
explicit commit()
, this does not require a round-trip to the
database. For maximum efficiency, set autoCommit
to true for the
last execute()
call of a transaction in preference to using an
additional, explicit commit()
call.
When a connection is released, any ongoing transaction will be rolled
back. Therefore if a released, pooled connection is used by a
subsequent pool.getConnection()
call, then any
DML statements performed on the obtained connection are always in a
new transaction.
When an application ends, any uncommitted transaction on a connection
will be rolled back.
Note: Oracle Database will implicitly commit when a
DDL
statement is executed irrespective of the value of autoCommit
.