Skip to content

Commit 3408789

Browse files
committed
Update isAutoCommit. Misc other formatting changes. Small fixes
1 parent 28d3312 commit 3408789

File tree

1 file changed

+47
-21
lines changed

1 file changed

+47
-21
lines changed

doc/api.md

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -255,21 +255,28 @@ and preventing any session information leaking between the two systems.
255255
Boolean isAutoCommit
256256
```
257257

258-
If this parameter is true, each [DML](https://docs.oracle.com/database/121/CNCPT/glossary.htm#CNCPT2042) statement is
259-
automatically committed.
258+
If this parameter is true, then the transaction in the current
259+
connection is automatically committed at the the end of statement
260+
execution.
260261

261-
By default, this property is false.
262+
The default value is false.
263+
264+
This parameter may be overridden in an `execute()` call.
265+
266+
Note: Oracle Database will implicitly commit when a [DDL](https://docs.oracle.com/database/121/CNCPT/glossary.htm#CHDJJGGF) statement is executed irrespective of the value of this property.
262267

263268
<a name="propdbmaxrows"></a>
264269
```
265270
Number maxRows
266271
```
267272

268273
The maximum number of rows that are fetched by the `execute()` call of the *Connection*
269-
object. This parameter may be overridden during the `execute()` call.
274+
object.
270275

271276
The default value is 100.
272277

278+
This parameter may be overridden in an `execute()` call.
279+
273280
To improve database efficiency, SQL queries should use a row
274281
limiting clause like [OFFSET /
275282
FETCH](https://docs.oracle.com/database/121/SQLRF/statements_10002.htm#BABEAACC)
@@ -299,55 +306,61 @@ Number poolIncrement
299306
```
300307

301308
The number of connections that are opened whenever a connection
302-
request exceeds the number of currently open connections. This
303-
parameter may be overridden when creating a connection pool.
309+
request exceeds the number of currently open connections.
304310

305311
The default value is 1.
306312

313+
This parameter may be overridden when creating a connection pool.
314+
307315
<a name="propdbpoolmax"></a>
308316
```
309317
Number poolMax
310318
```
311319

312320
The maximum number of connections to which a connection pool can grow.
313-
This parameter may be overridden when creating the connection pool.
314321

315322
The default value is 4.
316323

324+
This parameter may be overridden when creating the connection pool.
325+
317326
<a name="propdbpoolmin"></a>
318327
```
319328
Number poolMin
320329
```
321330

322331
The minimum number of connections a connection pool maintains, even if
323-
there is no activity to the target database of the pool. This
324-
parameter may be overridden when creating a connection pool.
332+
there is no activity to the target database of the pool.
325333

326334
The default value is 0.
327335

336+
This parameter may be overridden when creating a connection pool.
337+
328338
<a name="propdbpooltimeout"></a>
329339
```
330340
Number poolTimeout
331341
```
332342

333343
The time (in seconds) after which idle connections (unchecked out from
334-
the pool) are terminated. This parameter may be overridden when
335-
creating a connection pool. If the `poolTimeout` is set to 0, then idle
344+
the pool) are terminated. If the `poolTimeout` is set to 0, then idle
336345
connections are never terminated.
337346

338347
The default value is 60.
339348

349+
This parameter may be overridden when creating a connection pool.
350+
340351
<a name="propdbstmtcachesize"></a>
341352
```
342353
Number stmtCacheSize
343354
```
344355

345356
The number of statements that are cached in the [statement cache](#stmtcache) of
346-
each connection. This parameter may be overridden for specific *Pool* or
347-
*Connection* objects.
357+
each connection.
348358

349359
The default value is 30.
350360

361+
This parameter may be overridden for specific *Pool* or *Connection*
362+
objects.
363+
351364
In general, set the statement cache to the size of the working set of
352365
statements being executed by the application.
353366

@@ -372,8 +385,10 @@ This is an asynchronous call.
372385

373386
Internally, `createPool()` creates an [OCI Session
374387
Pool](https://docs.oracle.com/database/121/LNOCI/oci09adv.htm#LNOCI16617)
375-
for each Pool object. The default properties may be overridden by
376-
specifying new properties in the `poolAttrs` parameter.
388+
for each Pool object.
389+
390+
The default properties may be overridden by specifying new properties
391+
in the `poolAttrs` parameter.
377392

378393
A pool should be terminated with the `pool.terminate()` call.
379394

@@ -620,7 +635,7 @@ values.
620635

621636
<a name="proppoolconnectionsinuse"></a>
622637
```
623-
readonly Boolean connectionsInUse
638+
readonly Number connectionsInUse
624639
```
625640

626641
The number of currently active connections in the connection pool
@@ -674,9 +689,12 @@ readonly Number stmtCacheSize
674689
```
675690

676691
The number of statements that must be cached in the [statement cache](#stmtcache) of
677-
each connection. This parameter may be overridden for a specific
678-
Connection object. The default is the `stmtCacheSize` property of the
679-
*Oracledb* object when the pool is created.
692+
each connection.
693+
694+
The default is the `stmtCacheSize` property of the *Oracledb* object
695+
when the pool is created.
696+
697+
This parameter may be overridden for a specific Connection object.
680698

681699
### <a name="poolmethods"></a> 4.2 Pool Methods
682700

@@ -949,7 +967,7 @@ Option Property | Description
949967
----------------|-------------
950968
*Number maxRows* | Number of rows to fetch for `SELECT` statements. To improve database efficiency, SQL queries should use a row limiting clause like [OFFSET / FETCH](https://docs.oracle.com/database/121/SQLRF/statements_10002.htm#BABEAACC) or equivalent. The `maxRows` attribute can be used to stop badly coded queries from returning unexpectedly large numbers of rows.
951969
*String outFormat* | The format of rows fetched for `SELECT` statements. This can be either `ARRAY` or `OBJECT`. If specified as `ARRAY`, then each row is fetched as an array of column values. If specified as `OBJECT`, then each row is fetched as a JavaScript object.
952-
*Boolean isAutoCommit* | If it is true, then each [DML](https://docs.oracle.com/database/121/CNCPT/glossary.htm#CNCPT2042) is automatically committed. Note: Oracle Database will implicitly commit when a [DDL](https://docs.oracle.com/database/121/CNCPT/glossary.htm#CHDJJGGF) statement is executed.
970+
*Boolean isAutoCommit* | This overrides the `oracledb.isAutoCommit` property for this statement execution.
953971

954972
```
955973
function(Error error, [Object result])
@@ -1327,7 +1345,15 @@ The statement cache can be automatically tuned with the
13271345
## <a name="transactionmgt"></a> 6. Transaction Management
13281346

13291347
Node-oraclebd implements [`commit()`](#commit) and
1330-
[`rollback()`](#rollback) methods.
1348+
[`rollback()`](#rollback) methods that can be used to control
1349+
transactions.
1350+
1351+
If the [`isAutoCommit`](#propdbisautocommit) flag is set, then a
1352+
commit occurs at the end of each `execute()` call. This does not
1353+
require a round-trip to the database, unlike an explicit `commit()`.
1354+
For maximum efficiency, if a transaction consists of a number of
1355+
`execute()` calls, then set `isAutoCommit` to true for the last call
1356+
in preference to using an additional, explicit `commit()` call.
13311357

13321358
After all database calls on the connection complete, the application
13331359
should use the [`release()`](#release) call to release the connection.

0 commit comments

Comments
 (0)