@@ -51,7 +51,7 @@ describe('#integration Bolt V3 API', () => {
51
51
} )
52
52
53
53
it ( 'should set transaction metadata for auto-commit transaction' , async ( ) => {
54
- if ( ! databaseSupportsBoltV3 ( ) || ! databaseSupportsListTransaction ( ) ) {
54
+ if ( ! databaseSupportsBoltV3 ( ) || ! ( await databaseSupportsListTransaction ( ) ) ) {
55
55
return
56
56
}
57
57
@@ -93,7 +93,8 @@ describe('#integration Bolt V3 API', () => {
93
93
// ClientError on 4.1 and later
94
94
if (
95
95
e . code !== 'Neo.ClientError.Transaction.TransactionTimedOut' &&
96
- e . code !== 'Neo.TransientError.Transaction.LockClientStopped'
96
+ e . code !== 'Neo.TransientError.Transaction.LockClientStopped' &&
97
+ e . code !== 'Neo.ClientError.Transaction.LockClientStopped'
97
98
) {
98
99
fail ( 'Expected transaction timeout error but got: ' + e . code )
99
100
}
@@ -173,7 +174,7 @@ describe('#integration Bolt V3 API', () => {
173
174
)
174
175
175
176
it ( 'should set transaction metadata for explicit transactions' , async ( ) => {
176
- if ( ! databaseSupportsBoltV3 ( ) || ! databaseSupportsListTransaction ( ) ) {
177
+ if ( ! databaseSupportsBoltV3 ( ) || ! ( await databaseSupportsListTransaction ( ) ) ) {
177
178
return
178
179
}
179
180
@@ -216,7 +217,8 @@ describe('#integration Bolt V3 API', () => {
216
217
// ClientError on 4.1 and later
217
218
if (
218
219
e . code !== 'Neo.ClientError.Transaction.TransactionTimedOut' &&
219
- e . code !== 'Neo.TransientError.Transaction.LockClientStopped'
220
+ e . code !== 'Neo.TransientError.Transaction.LockClientStopped' &&
221
+ e . code !== 'Neo.ClientError.Transaction.LockClientStopped'
220
222
) {
221
223
fail ( 'Expected transaction timeout error but got: ' + e . code )
222
224
}
@@ -448,7 +450,7 @@ describe('#integration Bolt V3 API', () => {
448
450
} , 20000 )
449
451
450
452
async function testTransactionMetadataWithTransactionFunctions ( read ) {
451
- if ( ! databaseSupportsBoltV3 ( ) || ! databaseSupportsListTransaction ( ) ) {
453
+ if ( ! databaseSupportsBoltV3 ( ) || ! ( await databaseSupportsListTransaction ( ) ) ) {
452
454
return
453
455
}
454
456
@@ -552,7 +554,19 @@ describe('#integration Bolt V3 API', () => {
552
554
return protocolVersion >= 3
553
555
}
554
556
555
- function databaseSupportsListTransaction ( ) {
556
- return sharedNeo4j . edition === 'enterprise'
557
+ async function databaseSupportsListTransaction ( ) {
558
+ if ( sharedNeo4j . edition === 'enterprise' ) {
559
+ try {
560
+ await session . run (
561
+ 'CALL dbms.listTransactions()' ,
562
+ { }
563
+ )
564
+ return true
565
+ } catch ( e ) {
566
+ console . error ( 'Database does not support dbms.listTransactions()' , e )
567
+ return false
568
+ }
569
+ }
570
+ return false
557
571
}
558
572
} )
0 commit comments