@@ -24,7 +24,7 @@ import {
2424import { match } from 'ts-pattern' ;
2525import type { GetModels , SchemaDef } from '../../schema' ;
2626import { type ClientImpl } from '../client-impl' ;
27- import type { ClientContract } from '../contract' ;
27+ import { TransactionIsolationLevel , type ClientContract } from '../contract' ;
2828import { InternalError , QueryError } from '../errors' ;
2929import type {
3030 AfterEntityMutationCallback ,
@@ -213,7 +213,9 @@ export class ZenStackQueryExecutor<Schema extends SchemaDef> extends DefaultQuer
213213 return { result } ;
214214 } else {
215215 // if an on-the-fly tx is created, create one and wrap the query execution inside
216- await this . driver . beginTransaction ( connection , { isolationLevel : 'repeatable read' } ) ;
216+ await this . driver . beginTransaction ( connection , {
217+ isolationLevel : TransactionIsolationLevel . ReadCommitted ,
218+ } ) ;
217219 try {
218220 // execute the query inside the on-the-fly transaction
219221 const result = await connection . executeQuery < any > ( compiled ) ;
@@ -270,7 +272,9 @@ export class ZenStackQueryExecutor<Schema extends SchemaDef> extends DefaultQuer
270272 private hasPluginRequestingAfterMutationWithinTransaction (
271273 mutationInterceptionInfo : MutationInterceptionInfo < Schema > ,
272274 ) {
273- return [ ...mutationInterceptionInfo . perPlugin . values ( ) ] . some ( ( info ) => info . runAfterMutationWithinTransaction ) ;
275+ return [ ...mutationInterceptionInfo . perPlugin . values ( ) ] . some (
276+ ( info ) => info . intercept && info . runAfterMutationWithinTransaction ,
277+ ) ;
274278 }
275279
276280 private isMutationNode ( queryNode : RootOperationNode ) : queryNode is MutationQueryNode {
0 commit comments