Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

prisma query stuck at prisma.$transaction #551

Open
ayame30 opened this issue Jul 18, 2023 · 0 comments
Open

prisma query stuck at prisma.$transaction #551

ayame30 opened this issue Jul 18, 2023 · 0 comments

Comments

@ayame30
Copy link

ayame30 commented Jul 18, 2023

Describe the bug
for case prisma.$transaction([queryA, queryB]) , if queryA was found in cache, queryB will stuck in transaction.

To Reproduce
Steps to reproduce the behavior:

async paginatedResult(skip: number) {
  const [totalCount, result] = await this.prisma.$transaction([
    this.prisma.article.count(),
    this.prisma.article.findMany({ skip })
  ]);
  return { totalCount, result };
}
  1. query with paginatedResult(0)
  2. response 200 successfully, and result cached
  3. query with paginatedResult(1)
  4. request freeze until timeout

Expected behavior
for case prisma.$transaction([queryA, queryB]) , return cached result if both queryA and queryB was found in cache, otherwise fetch from prisma.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: postman
  • Version: ^4.8.0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants