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

Lock handling support #4009

Merged
merged 1 commit into from
Jun 9, 2021
Merged

Lock handling support #4009

merged 1 commit into from
Jun 9, 2021

Conversation

beikov
Copy link
Contributor

@beikov beikov commented May 25, 2021

  • Move locking tests to orm package
  • Implement applying locks in SqlAstTranslator and thus make queries that have locks cacheable
  • Implement follow on locking
  • Update H2 to 1.4.200 which is necessary because some lock tests didn't work with 1.4.199
  • Replace LockMode in SqlAst and Fetch/DomainResult with source alias to resolve lock modes right before execution
  • Add CTE materialization option to force materialization of the ID select CTE for certain PostgreSQL versions
  • Acquire locks for ID select queries if possible
  • New Dialect methods getWriteLockRowIdentifier(), getReadLockRowIdentifier() as replacement for forUpdateOfColumns
  • Add ability to mark function as aggregate and allow SQL FILTER clause being attached
    ** Needed to determine whether follow on locking is required
  • Capture whether a function is an aggregate in descriptor and introduce SelfRenderingSqmAggregateFunction for rendering SQL FILTER clause

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented May 25, 2021

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [5f4b097]

› This message was automatically generated.

@beikov beikov force-pushed the lock-handling branch 8 times, most recently from 08b921a to c4c129f Compare June 1, 2021 07:52
@dreab8 dreab8 added the 6.0 label Jun 1, 2021
@beikov beikov force-pushed the lock-handling branch 11 times, most recently from 24252d7 to d3dca21 Compare June 8, 2021 16:02
… the source alias to resolve lock mode during initializer creation. Introduce notion of aggregate function with an optional filter clause. Implement support for rendering locks into SQL. Move locking tests to orm package
result = 31 * result + ( followOnLocking != null ? followOnLocking.hashCode() : 0 );
result = 31 * result + ( scope ? 1 : 0 );
return result;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to use Objects static util methods to simplify, if only from code readability perspective.

@Override
public boolean supportsNoWait() {
return getVersion() >= 2010;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can reuse this method in other methods to centralize the logic.

@@ -3515,6 +3534,15 @@ public boolean supportsNoWait() {
return false;
}

/**
* Does this dialect/database support WAIT timeout.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super minor, but a '?' seems better alternative at the end of sentence.

@beikov beikov merged commit 5e08647 into hibernate:wip/6.0 Jun 9, 2021
@beikov beikov deleted the lock-handling branch May 22, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants