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 @@ -45,20 +45,6 @@ import type { WriteConcern } from './write_concern';
45
45
46
46
const minWireVersionForShardedTransactions = 8 ;
47
47
48
- function assertAlive ( session : ClientSession , callback ?: Callback ) : boolean {
49
- if ( session . serverSession == null ) {
50
- const error = new MongoExpiredSessionError ( ) ;
51
- if ( typeof callback === 'function' ) {
52
- callback ( error ) ;
53
- return false ;
54
- }
55
-
56
- throw error ;
57
- }
58
-
59
- return true ;
60
- }
61
-
62
48
/** @public */
63
49
export interface ClientSessionOptions {
64
50
/** Whether causal consistency should be enabled on this session */
@@ -396,7 +382,6 @@ export class ClientSession extends TypedEventEmitter<ClientSessionEvents> {
396
382
throw new MongoCompatibilityError ( 'Transactions are not allowed with snapshot sessions' ) ;
397
383
}
398
384
399
- assertAlive ( this ) ;
400
385
if ( this . inTransaction ( ) ) {
401
386
throw new MongoTransactionError ( 'Transaction already in progress' ) ;
402
387
}
@@ -657,11 +642,6 @@ function attemptTransaction<TSchema>(
657
642
}
658
643
659
644
function endTransaction ( session : ClientSession , commandName : string , callback : Callback < Document > ) {
660
- if ( ! assertAlive ( session , callback ) ) {
661
- // checking result in case callback was called
662
- return ;
663
- }
664
-
665
645
// handle any initial problematic cases
666
646
const txnState = session . transaction . state ;
667
647
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