Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cockroach Lock Modes #8249

Closed
wodka opened this issue Oct 6, 2021 · 0 comments · Fixed by #8250
Closed

Cockroach Lock Modes #8249

wodka opened this issue Oct 6, 2021 · 0 comments · Fixed by #8250

Comments

@wodka
Copy link
Contributor

wodka commented Oct 6, 2021

Issue Description

Cockroach does support the lock modes as Postgres

https://www.cockroachlabs.com/docs/stable/select-for-update.html

But when trying to lock a transaction it will throw LockNotSupportedOnGivenDriverError

Code Block is in here https://github.com/alfonsoal1983/typeorm/blob/master/src/query-builder/SelectQueryBuilder.ts#L1596

Expected Behavior

it should allow both pessimistic_read and pessimistic_write lock

Actual Behavior

trying to lock a transaction will throw LockNotSupportedOnGivenDriverError

Steps to Reproduce

  1. start a transaction
  2. select with lock
await repository.manager.transaction(async (em) => {
      const token = await em.findOne(SomeEntity, {
        where: {
          id: 12,
        },
        lock: {
          mode: 'pessimistic_write',
        },
      })
})

My Environment

Dependency Version
Operating System
Node.js version 14, 16
Typescript version 4.3.5
TypeORM version 0.2.36

Additional Context

Relevant Database Driver(s)

DB Type Reproducible
aurora-data-api no
aurora-data-api-pg no
better-sqlite3 no
cockroachdb yes
cordova no
expo no
mongodb no
mysql no
nativescript no
oracle no
postgres no
react-native no
sap no
sqlite no
sqlite-abstract no
sqljs no
sqlserver no

Are you willing to resolve this issue by submitting a Pull Request?

  • ✅ Yes, I have the time, and I know how to start.
  • ✖️ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✅ Yes, I don’t have the time, but I can support (using donations) development.
  • ✅ Yes, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
wodka added a commit to wodka/typeorm that referenced this issue Oct 6, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 6, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 6, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 6, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 6, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 6, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 6, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 6, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 7, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 7, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 11, 2021
wodka added a commit to wodka/typeorm that referenced this issue Oct 11, 2021
wodka added a commit to wodka/typeorm that referenced this issue Nov 18, 2021
pleerock pushed a commit that referenced this issue Nov 18, 2021
HeartPattern pushed a commit to HeartPattern/typeorm that referenced this issue Nov 29, 2021
HeartPattern pushed a commit to HeartPattern/typeorm that referenced this issue Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant