-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Investigating Update outside transition 2lc #8849
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
Conversation
| public void after(SessionFactoryScope scope) { | ||
| scope.inTransaction( | ||
| session -> | ||
| session.createQuery( "delete Customer" ).executeUpdate() |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
| public void testUpdateCachedEntity(SessionFactoryScope scope) { | ||
| scope.inTransaction( | ||
| session -> | ||
| session.createNativeQuery( "update Customer set id = id" ).executeUpdate() |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
| public void testUpdateCachedOutsideTransaction(SessionFactoryScope scope) { | ||
| scope.inSession( | ||
| session -> | ||
| session.createNativeQuery( "update Customer set id = id" ).executeUpdate() |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
| this( DefaultCacheKeysFactory.INSTANCE, properties ); | ||
| } | ||
|
|
||
| public TestCachingRegionFactory(CacheKeysFactory cacheKeysFactory, Properties properties) { |
Check notice
Code scanning / CodeQL
Useless parameter
|
We talked about this approach as an alternative to https://hibernate.atlassian.net/browse/HHH-18546 @yrodiere had some concerns with the approach in regards to some things done in Hibernate Search. Let's see if he can demonstrate that and we should incorporate his findings, if so. |
My concern regarding Hibernate Search was if we generalize the approach of executing "after transaction" operations immediately, since Hibernate Search does that itself. If we do that (which we aren't in this PR), then we'll just have to run Hibernate Search integration tests against the Hibernate ORM snapshots to see if tests still pass, and improvise. Regarding this patch specifically, I'm discussing it with Andrea right now (though just to give this another pair of eyeballs; you sure know what this implies better than I do). |
|
as suggested by @sebersole probably better to provide a logging in case the operation is executed outside a TX so something like |
|
Just for reference, I believe this was fixed via #9812 |
bulk query execution inside a Transaction
what happens now for a bulk native query executed ouside a Transaction :
bulk native query update execution outside Transaction with #8849 (comment)
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.