zenstackhq / zenstack

Fullstack TypeScript toolkit that enhances Prisma ORM with flexible Authorization layer for RBAC/ABAC/PBAC/ReBAC, offering auto-generated type-safe APIs and frontend hooks.

Home Page:https://zenstack.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Create throws RESULT_NOT_READABLE when MySQL transaction_isolation is not "READ-UNCOMMITTED"

OiAnthony opened this issue · comments

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Create throws RESULT_NOT_READABLE when MySQL transaction_isolation is not "READ-UNCOMMITTED"

Describe the solution you'd like
A clear and concise description of what you want to happen.

  1. Check MySQL transaction_isolation, when transaction_isolation is not equal to "Read-Uncommitted", LOG warning
  2. Create and readBack Shouldn't it appear in the same thing? Dirty reading may appear

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
At present, I took the initiative to change MySQL transaction_isolation to "Read-Uncommitted"

Additional context
Add any other context or screenshots about the feature request here.
image

Hi @OiAnthony , thanks for reporting this. Yes, ZenStack relies on reading uncommitted changes to enforce access policies. For the specific case of checking readability after creating, we can do the read after committing the create, but there're other cases where reading uncommitted changes is needed. I'll see if we can detect the current transaction settings, and will at least add something to the documentation about it.