Skip to content
Discussion options

You must be logged in to vote

Your best bet would be to access the transactionAsyncLocalStorage directly:

const transactionAsyncLocalStorage = mongoose.transactionAsyncLocalStorage.getStore();
if (transactionAsyncLocalStorage.session && transactionAsyncLocalStorage.session.inTransaction()) {
  // In transaction
} else {
  // not in transaction
}

Does that work for you?

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mjanos10
Comment options

@vkarpov15
Comment options

@mjanos10
Comment options

@vkarpov15
Comment options

Answer selected by mjanos10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants