Skip to content

Conversation

sebersole
Copy link
Member

@sebersole sebersole commented Aug 14, 2025

Invesigate proper support for certain events (AbstractDatabaseOperationEvent and friends) from StatelessSession.

hibernate/hibernate-reactive#394


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19737

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Aug 14, 2025

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

@sebersole sebersole changed the title EventSource - StatelessSession and Envers HHH-19737 - Support Envers with StatelessSession Aug 26, 2025
}

private void handlePostUpsert(Object entity, EventSource source) {
private void handlePostUpsert(Object entity, SharedSessionContractImplementor source) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'entity' is never used.
}

private void handlePostUpsert(Object entity, EventSource source) {
private void handlePostUpsert(Object entity, SharedSessionContractImplementor source) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'source' is never used.
revisionInfoGenerator.saveRevisionData( session, revisionData );
}
}
else if ( session instanceof StatelessSessionImplementor statelessSession ) {

Check notice

Code scanning / CodeQL

Unread local variable

Variable 'StatelessSessionImplementor statelessSession' is never read.
* @param vwu Performed work unit.
*/
public void entityChanged(Session session, Object currentRevisionData, AuditWorkUnit vwu) {
public void entityChanged(SharedSessionContractImplementor session, Object currentRevisionData, AuditWorkUnit vwu) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'session' is never used.
@sebersole sebersole marked this pull request as ready for review August 28, 2025 03:24
# Conflicts:
#	hibernate-core/src/main/java/org/hibernate/engine/spi/AbstractDelegatingSharedSessionBuilder.java
#	hibernate-core/src/main/java/org/hibernate/event/internal/DefaultLockEventListener.java
#	hibernate-core/src/main/java/org/hibernate/internal/StatelessSessionImpl.java

# Conflicts:
#	hibernate-core/src/main/java/org/hibernate/cache/internal/CollectionCacheInvalidator.java
@Override
SharedStatelessSessionBuilder noInterceptor();

SharedStatelessSessionBuilder statementInspector(UnaryOperator<String> operator);

Check notice

Code scanning / CodeQL

Missing Override annotation

This method overrides [CommonSharedBuilder.statementInspector](1); it is advisable to add an Override annotation.
SessionBuilderImplementor tenantIdentifier(String tenantIdentifier);

@Override
SessionBuilderImplementor tenantIdentifier(Object tenantIdentifier);

Check notice

Code scanning / CodeQL

Confusing overloading of methods

Method SessionBuilderImplementor.tenantIdentifier(..) could be confused with overloaded method [tenantIdentifier](1), since dispatch depends on static types.
@sebersole
Copy link
Member Author

Fixed conflicts and integrated manually

@sebersole sebersole closed this Sep 9, 2025
@gavinking
Copy link
Member

👏👏 Fantastic, this all looks great!

One small nitpick: I'm not sure about the package for the new incubating APIs. I can see why you don't want to throw them into org.hibernate. But org.hibernate.engine doesn't seem like a great fit. If they can't go into org.hibernate, I would make a new package for them, org.hibernate.builder or whatever, WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants