File tree Expand file tree Collapse file tree 2 files changed +1
-21
lines changed Expand file tree Collapse file tree 2 files changed +1
-21
lines changed Original file line number Diff line number Diff line change @@ -42,20 +42,6 @@ import {
42
42
43
43
const minWireVersionForShardedTransactions = 8 ;
44
44
45
- function assertAlive ( session : ClientSession , callback ?: Callback ) : boolean {
46
- if ( session . serverSession == null ) {
47
- const error = new MongoExpiredSessionError ( ) ;
48
- if ( typeof callback === 'function' ) {
49
- callback ( error ) ;
50
- return false ;
51
- }
52
-
53
- throw error ;
54
- }
55
-
56
- return true ;
57
- }
58
-
59
45
/** @public */
60
46
export interface ClientSessionOptions {
61
47
/** Whether causal consistency should be enabled on this session */
@@ -393,7 +379,6 @@ export class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
393
379
throw new MongoCompatibilityError ( 'Transactions are not allowed with snapshot sessions' ) ;
394
380
}
395
381
396
- assertAlive ( this ) ;
397
382
if ( this . inTransaction ( ) ) {
398
383
throw new MongoTransactionError ( 'Transaction already in progress' ) ;
399
384
}
@@ -658,11 +643,6 @@ function endTransaction(
658
643
commandName : 'abortTransaction' | 'commitTransaction' ,
659
644
callback : Callback < Document >
660
645
) {
661
- if ( ! assertAlive ( session , callback ) ) {
662
- // checking result in case callback was called
663
- return ;
664
- }
665
-
666
646
// handle any initial problematic cases
667
647
const txnState = session . transaction . state ;
668
648
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ describe('Sessions - unit', function () {
91
91
expect ( session . clusterTime ) . to . eql ( clusterTime ) ;
92
92
} ) ;
93
93
94
- it ( 'should not acquire a serverSession inside incrementTxnNumber ' , ( ) => {
94
+ it ( 'should not acquire a serverSession inside incrementTransactionNumber ' , ( ) => {
95
95
const client = new Topology ( topologyHost , topologyOptions ) ;
96
96
const sessionPool = client . s . sessionPool ;
97
97
const session = new ClientSession ( client , sessionPool , { } ) ;
You can’t perform that action at this time.
0 commit comments