-
Notifications
You must be signed in to change notification settings - Fork 38.1k
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
EclipseLinkJpaDialect applies per-transaction isolation level to shared DatabasePlatform #24802
Comments
@deanwong, I think you meant to use |
@sbrannen yes correct
|
|
We use Hikari as connection pool, does that affect the behavior? |
I suspect that EclipseLink applies the transaction isolation level to the underlying JDBC Connection but does not restore the original isolation level there before it returns the Connection to the pool. As far as I can see, it does not expose the current connection isolation level via |
@jhoeller |
transactionIsolation field in DatabasePlatform stores various database settings that rarely An instance of this class is called by JpaTransactionManager which is a Spring To remedy this problem I supplied CustomOraclePlatform bean where I override |
Well spotted, these calls internally delegate to the shared |
I've locally applied a different patch: Using a custom |
Quick update: There seems to be a problem with propagating such a custom login instance to the actual session used. EclipseLink's internal architecture doesn't make this very obvious... let's see whether we can reach a solution here, otherwise we might have to go with a different approach. |
It looks like this can only really be solved through a custom |
Can you just set transaction isolation level directly on a JDBC Connection thus overriding whatever EclipseLink does? |
We could try to operate directly on the JDBC Connection but we'd have to clarify when exactly an EclipseLink Session obtains its JDBC Connection and when exactly it returns the Connection to the pool. Hibernate has well-defined connection policies for that purpose, whereas with EclipseLink we'd probably have to rely on implementation behavior (hoping that it won't change). |
We're rolling an While this still operates on a shared |
spring orm version: 5.1.4.RELEASE
In EclipseLinkJpaDialect class line 81
for instance:
If txA beginTransaction and there is Isolation.SERIALIZABLE around the repository class, the TransactionIsolation in uow.getLogin() will be changed to Isolation.SERIALIZABLE.
Then txB beginTransaction with Isolation.DEFAULT, the condition is not met, TransactionIsolation in uow.getLogin() still be SERIALIZABLE.
I think the right code should like this:
The text was updated successfully, but these errors were encountered: