@@ -38,6 +38,7 @@ import ManagedTransaction from './transaction-managed'
3838import BookmarkManager from './bookmark-manager'
3939import { Dict } from './record'
4040import NotificationFilter from './notification-filter'
41+ import { Logger } from './internal/logger'
4142
4243type ConnectionConsumer = ( connection : Connection | null ) => any | undefined | Promise < any > | Promise < undefined >
4344type TransactionWork < T > = ( tx : Transaction ) => Promise < T > | T
@@ -74,6 +75,7 @@ class Session {
7475 private readonly _results : Result [ ]
7576 private readonly _bookmarkManager ?: BookmarkManager
7677 private readonly _notificationFilter ?: NotificationFilter
78+ private readonly _log ?: Logger
7779 /**
7880 * @constructor
7981 * @protected
@@ -100,7 +102,8 @@ class Session {
100102 impersonatedUser,
101103 bookmarkManager,
102104 notificationFilter,
103- auth
105+ auth,
106+ log
104107 } : {
105108 mode : SessionMode
106109 connectionProvider : ConnectionProvider
@@ -113,6 +116,7 @@ class Session {
113116 bookmarkManager ?: BookmarkManager
114117 notificationFilter ?: NotificationFilter
115118 auth ?: AuthToken
119+ log : Logger
116120 } ) {
117121 this . _mode = mode
118122 this . _database = database
@@ -153,6 +157,7 @@ class Session {
153157 this . _results = [ ]
154158 this . _bookmarkManager = bookmarkManager
155159 this . _notificationFilter = notificationFilter
160+ this . _log = log
156161 }
157162
158163 /**
@@ -176,7 +181,7 @@ class Session {
176181 parameters
177182 )
178183 const autoCommitTxConfig = ( transactionConfig != null )
179- ? new TxConfig ( transactionConfig )
184+ ? new TxConfig ( transactionConfig , this . _log )
180185 : TxConfig . empty ( )
181186
182187 const result = this . _run ( validatedQuery , params , async connection => {
@@ -279,7 +284,7 @@ class Session {
279284
280285 let txConfig = TxConfig . empty ( )
281286 if ( arg != null ) {
282- txConfig = new TxConfig ( arg )
287+ txConfig = new TxConfig ( arg , this . _log )
283288 }
284289
285290 return this . _beginTransaction ( this . _mode , txConfig )
@@ -385,7 +390,7 @@ class Session {
385390 transactionWork : TransactionWork < T > ,
386391 transactionConfig ?: TransactionConfig
387392 ) : Promise < T > {
388- const config = new TxConfig ( transactionConfig )
393+ const config = new TxConfig ( transactionConfig , this . _log )
389394 return this . _runTransaction ( ACCESS_MODE_READ , config , transactionWork )
390395 }
391396
@@ -410,7 +415,7 @@ class Session {
410415 transactionWork : TransactionWork < T > ,
411416 transactionConfig ?: TransactionConfig
412417 ) : Promise < T > {
413- const config = new TxConfig ( transactionConfig )
418+ const config = new TxConfig ( transactionConfig , this . _log )
414419 return this . _runTransaction ( ACCESS_MODE_WRITE , config , transactionWork )
415420 }
416421
@@ -443,7 +448,7 @@ class Session {
443448 transactionWork : ManagedTransactionWork < T > ,
444449 transactionConfig ?: TransactionConfig
445450 ) : Promise < T > {
446- const config = new TxConfig ( transactionConfig )
451+ const config = new TxConfig ( transactionConfig , this . _log )
447452 return this . _executeInTransaction ( ACCESS_MODE_READ , config , transactionWork )
448453 }
449454
@@ -465,7 +470,7 @@ class Session {
465470 transactionWork : ManagedTransactionWork < T > ,
466471 transactionConfig ?: TransactionConfig
467472 ) : Promise < T > {
468- const config = new TxConfig ( transactionConfig )
473+ const config = new TxConfig ( transactionConfig , this . _log )
469474 return this . _executeInTransaction ( ACCESS_MODE_WRITE , config , transactionWork )
470475 }
471476
0 commit comments