prisma: The server failed to resume the transaction. Desc:3600000005.

Hi Prisma Team! My Prisma Client just crashed.

My code below does the SQL Server updates just fine if sent with some time between calls, when several are received in a short space of time I receive the error below. Currently I consistently experience the problem when sending 6 or more requests simultaneously, some will work, some will return the error below, generally more than half the requests fail and the ones that do fail are random ie. not the same records every time.

This is the report:

Versions

Name Version
Node v12.15.0
OS windows
Prisma Client 2.25.0
Query Engine query-engine c838e79f39885bc8e1611849b1eb28b5bb5bc922
Database undefined

Query

mutation {
  updateOneProjectTask(
    where: {
      PRT_IRN: 5
    }
    data: {
      PRT_PRT_IRN: null
      PRT_NAME: "X"
      PRT_START: "X"
      PRT_END: "X"
      PRT_ORDER: 5
      PRT_PROGRESS: 5
      PRT_SUMMARY: false
      PRT_EXPANDED: true
      PRT_TAGS: null
      PRT_LEAD_USR_IRN: null
    }
  ) {
    PRT_IRN
    PRT_PRJ_IRN
    PRT_FLAGDELETE
    PRT_PRT_IRN
    PRT_NAME
    PRT_START
    PRT_END
    PRT_ORDER
    PRT_PROGRESS
    PRT_SUMMARY
    PRT_EXPANDED
    PRT_TAGS
    PRT_LEAD_USR_IRN
  }
}

Logs

8;5;78;1mprisma:engine       at async updateProjectTask (F:\Dev\Project\Source\server\api\schema\resolvers\projecttask.js:131:19)
  prisma:engine       at async graphqlMiddleware (F:\Dev\Project\Source\server\api\node_modules\express-graphql\index.js:125:26) {
  prisma:engine     clientVersion: '2.25.0'
  prisma:engine   }
  prisma:engine }  
  prisma:engine stdout  The transaction active in this session has been committed or aborted by another session.  
  prisma:engine stdout  The server failed to resume the transaction. Desc:3600000005.  
  prisma:engine {
  prisma:engine   error: PrismaClientUnknownRequestError2 [PrismaClientUnknownRequestError]: Error in connector: Error querying the database: 'The server failed to resume the transaction. Desc:3600000005.' on server DEV4\SQLSERVER2017STD executing  on line 1 (code: 3971, state: 1, class: 16)
  prisma:engine       at NodeEngine.graphQLToJSError (F:\Dev\Project\Source\server\api\node_modules\@prisma\client\runtime\index.js:28016:14)
  prisma:engine       at NodeEngine.request (F:\Dev\Project\Source\server\api\node_modules\@prisma\client\runtime\index.js:27912:24)
  prisma:engine       at processTicksAndRejections (internal/process/task_queues.js:94:5)
  prisma:engine       at async cb (F:\Dev\Project\Source\server\api\node_modules\@prisma\client\runtime\index.js:33786:26)
  prisma:engine       at async updateProjectTask (F:\Dev\Project\Source\server\api\schema\resolvers\projecttask.js:131:19)
  prisma:engine       at async graphqlMiddleware (F:\Dev\Project\Source\server\api\node_modules\express-graphql\index.js:125:26) {
  prisma:engine     clientVersion: '2.25.0'
  prisma:engine   }
  prisma:engine }  
  prisma:engine stdout  The transaction active in this session has been committed or aborted by another session.  
  prisma:engine stdout  The server failed to resume the transaction. Desc:3600000005.  
  prisma:engine {
  prisma:engine   error: PrismaClientUnknownRequestError2 [PrismaClientUnknownRequestError]: Error in connector: Error querying the database: 'The server failed to resume the transaction. Desc:3600000005.' on server DEV4\SQLSERVER2017STD executing  on line 1 (code: 3971, state: 1, class: 16)
  prisma:engine       at NodeEngine.graphQLToJSError (F:\Dev\Project\Source\server\api\node_modules\@prisma\client\runtime\index.js:28016:14)
  prisma:engine       at NodeEngine.request (F:\Dev\Project\Source\server\api\node_modules\@prisma\client\runtime\index.js:27912:24)
  prisma:engine       at processTicksAndRejections (internal/process/task_queues.js:94:5)
  prisma:engine       at async cb (F:\Dev\Project\Source\server\api\node_modules\@prisma\client\runtime\index.js:33786:26)
  prisma:engine       at async updateProjectTask (F:\Dev\Project\Source\server\api\schema\resolvers\projecttask.js:131:19)
  prisma:engine       at async graphqlMiddleware (F:\Dev\Project\Source\server\api\node_modules\express-graphql\index.js:125:26) {
  prisma:engine     clientVersion: '2.25.0'
  prisma:engine   }
  prisma:engine }  
  prisma:engine stdout  The transaction active in this session has been committed or aborted by another session.  
  prisma:engine stdout  The server failed to resume the transaction. Desc:3600000005.  
  prisma:engine {
  prisma:engine   error: PrismaClientUnknownRequestError2 [PrismaClientUnknownRequestError]: Error in connector: Error querying the database: 'The server failed to resume the transaction. Desc:3600000005.' on server DEV4\SQLSERVER2017STD executing  on line 1 (code: 3971, state: 1, class: 16)
  prisma:engine       at NodeEngine.graphQLToJSError (F:\Dev\Project\Source\server\api\node_modules\@prisma\client\runtime\index.js:28016:14)
  prisma:engine       at NodeEngine.request (F:\Dev\Project\Source\server\api\node_modules\@prisma\client\runtime\index.js:27912:24)
  prisma:engine       at processTicksAndRejections (internal/process/task_queues.js:94:5)
  prisma:engine       at async cb (F:\Dev\Project\Source\server\api\node_modules\@prisma\client\runtime\index.js:33786:26)
  prisma:engine       at async updateProjectTask (F:\Dev\Project\Source\server\api\schema\resolvers\projecttask.js:131:19)
  prisma:engine       at async graphqlMiddleware (F:\Dev\Project\Source\server\api\node_modules\express-graphql\index.js:125:26) {
  prisma:engine     clientVersion: '2.25.0'
  prisma:engine   }
  prisma:engine }  

Client Snippet

    updateProjectTask: async function (_, { projectTask }, context) {

      const pts = await context.prisma.projectTask.update({
        where: { PRT_IRN: projectTask.PRT_IRN },
        data: {           
          PRT_PRT_IRN: projectTask.PRT_PRT_IRN,
          PRT_NAME: projectTask.PRT_NAME,
          PRT_START: projectTask.PRT_START,
          PRT_END: projectTask.PRT_END,
          PRT_ORDER: projectTask.PRT_ORDER,
          PRT_PROGRESS: projectTask.PRT_PROGRESS,
          PRT_SUMMARY: projectTask.PRT_SUMMARY,
          PRT_EXPANDED: projectTask.PRT_EXPANDED,
          PRT_TAGS: projectTask.PRT_TAGS,
          PRT_LEAD_USR_IRN: projectTask.PRT_LEAD_USR_IRN ? projectTask.PRT_LEAD_USR_IRN : null,
        }
      }) 
      return {} 
    }

Schema

generator client {
  provider = "prisma-client-js"
  previewFeatures = ["microsoftSqlServer"]
}

model Project {  
  PRJ_IRN       Int @id @default(autoincrement())
  PRJ_NAME      String  
  PRJ_DESC      String?
  PRJ_LEAD_USR_IRN    Int?
  PROJECTTASK         ProjectTask[]
  PROJECTRESOURCE     ProjectResource[]
  PROJECTLINK         ProjectLink[]
  PROJECTBUDGET       ProjectBudget[]
  USER_PROJECTLEAD    User? @relation(fields: [PRJ_LEAD_USR_IRN], references: [USR_IRN])
  @@map(name: "PROJECTS")
}

model ProjectBudget {
  BUD_IRN         Int @id @default(autoincrement())
  BUD_PRJ_IRN     Int  
  BUD_NAME        String
  BUD_COST        Float
  PROJECTRESOURCE   ProjectResource[]
  PROJECT           Project @relation(fields: [BUD_PRJ_IRN], references: [PRJ_IRN])    
  @@map(name: "PROJECT_BUDGETS")
}

model ProjectTask {
  PRT_IRN         Int @id @default(autoincrement())
  PRT_PRJ_IRN     Int
  PRT_FLAGDELETE  Boolean?
  PRT_PRT_IRN     Int?
  PRT_NAME        String
  PRT_START       DateTime
  PRT_END         DateTime
  PRT_ORDER       Int
  PRT_PROGRESS    Int
  PRT_SUMMARY       Boolean
  PRT_EXPANDED      Boolean
  PRT_TAGS          String?
  PRT_LEAD_USR_IRN  Int?
  PROJECTTASKASSIGNMENT ProjectTaskAssignment[]
  PROJECTTASKNOTE       ProjectTaskNote[]
  PROJECTLINK_SOURCE    ProjectLink[] @relation(name: "ProjectLink_Source")
  PROJECTLINK_TARGET    ProjectLink[] @relation(name: "ProjectLink_Target")
  PROJECT               Project @relation(fields: [PRT_PRJ_IRN], references: [PRJ_IRN])
  USER_PROJECTTASKLEAD  User? @relation(fields: [PRT_LEAD_USR_IRN], references: [USR_IRN])   
  @@map(name: "PROJECT_TASKS")
}

model ProjectTaskAssignment {
  PTA_IRN       Int @id @default(autoincrement())
  PTA_PRT_IRN   Int
  PTA_RES_IRN   Int
  PTA_FLAGDELETE  Boolean?
  PTA_VALUE       Float?
  PROJECTTASK     ProjectTask @relation(fields: [PTA_PRT_IRN], references: [PRT_IRN])
  PROJECTRESOURCE ProjectResource @relation(fields: [PTA_RES_IRN], references: [RES_IRN])
  @@map(name: "PROJECT_TASK_ASSIGNMENTS")
}

model ProjectTaskNote {
  PTN_IRN       Int @id @default(autoincrement())
  PTN_PRT_IRN   Int
  PTN_USR_IRN   Int
  PTN_DATE      DateTime
  PTN_NOTE      String
  PROJECTTASK     ProjectTask @relation(fields: [PTN_PRT_IRN], references: [PRT_IRN])
  USER            User @relation(fields: [PTN_USR_IRN], references: [USR_IRN])
  @@map(name: "PROJECT_TASK_NOTES")
}

model ProjectLink {
  PLI_IRN       Int @id @default(autoincrement())
  PLI_PRJ_IRN   Int
  PLI_FLAGDELETE  Boolean?
  PLI_SOURCE_PRT_IRN   Int
  PLI_TARGET_PRT_IRN   Int
  PLI_TYPE   Int
  PROJECT                 Project @relation(fields: [PLI_PRJ_IRN], references: [PRJ_IRN])  
  PROJECTTASK_SOURCE      ProjectTask @relation(name: "ProjectLink_Source", fields: [PLI_SOURCE_PRT_IRN], references: [PRT_IRN])
  PROJECTTASK_TARGET      ProjectTask @relation(name: "ProjectLink_Target", fields: [PLI_TARGET_PRT_IRN], references: [PRT_IRN])
  @@map(name: "PROJECT_LINKS")
}

model ProjectResource {
  RES_IRN       Int @id @default(autoincrement())
  RES_PRJ_IRN   Int
  RES_NAME      String
  RES_TYPE      String
  RES_BUD_IRN   Int?
  RES_UNIT      String
  RES_COST      Float?
  RES_PERUSECOST  Float?
  RES_CALCULATION String
  RES_COLOUR      String?
  RES_FLAGDELETE  Boolean?  
  RES_USR_IRN     Int?
  PROJECTTASKASSIGNMENT ProjectTaskAssignment[]
  PROJECT               Project @relation(fields: [RES_PRJ_IRN], references: [PRJ_IRN])
  PROJECTBUDGET         ProjectBudget? @relation(fields: [RES_BUD_IRN], references: [BUD_IRN])
  USER                  User? @relation(fields: [RES_USR_IRN], references: [USR_IRN])
  @@map(name: "PROJECT_RESOURCES")
}

model User {
  USR_IRN       Int @id @default(autoincrement())
  USR_USERID    String
  USR_NAME      String  
  USR_EMAIL     String?
  USR_PHONE     String?
  USR_TITLE     String?
  USR_SOURCE    String?
  USR_PHOTO     String?
  PROJECTRESOURCE   ProjectResource[]   
  PROJECT_LEAD      Project[]
  PROJECTTASK_LEAD  ProjectTask[]
  PROJECTTASKNOTE   ProjectTaskNote[]
  @@map(name: "USERS")
}

model Setting {  
  SET_KEY       String @id 
  SET_VALUE     String?    
  @@map(name: "SETTINGS")
}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (15 by maintainers)

Most upvoted comments

Yep, I guessed right it’s the ROLLBACK we do not short-circuit anymore, and this is your real error.

Howdy. We are seeing this issue also in a simple GraphQL mutation when the length of variables in the mutation grows to a certain amount, maybe around 1000 characters in total. (using “prisma”: “^2.30.3”)