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

Agroal - Allow to configure transaction isolation level #1122 #1778

Merged
merged 1 commit into from
Apr 2, 2019

Conversation

machi1990
Copy link
Member

The PR adds the possibility to define database transaction isolation level using quarkus.datasource.transaction-isolation config property.

@gsmet

@gsmet gsmet self-assigned this Mar 31, 2019
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

@machi1990 nice work. I just added a comment regarding the config property name. I think we'd better be explicit.

@@ -8,3 +8,4 @@ quarkus.datasource.background-validation-interval=PT53S
quarkus.datasource.acquisition-timeout=PT54S
quarkus.datasource.leak-detection-interval=PT55S
quarkus.datasource.idle-removal-interval=PT56S
quarkus.datasource.transaction-isolation=SERIALIZABLE
Copy link
Member

Choose a reason for hiding this comment

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

I think I would have named it transaction-isolation-level.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@gsmet
Copy link
Member

gsmet commented Apr 1, 2019

@machi1990 I'm wondering if we should have our own enum for the isolation level values. Right now, we are totally tied to the Agroal values and I think it would be better if we had our own enum.

I think I would have string values like read-committed, read-uncommitted and the TransactionIsolationLevel enum would have a public static TransactionIsolationLevel of(String value) method so that it automatically is transformed by MicroProfile Config.

We would then translate the values to the Agroal values.

What do you think of this proposal?

@machi1990
Copy link
Member Author

@gsmet, I like the idea. It will totally abstract the end user from the Agroal’s transaction isolation level enum. I’ll take this into account.

A small downside will be maintaining our own enum, should there be any breaking change in Agroal.

@gsmet
Copy link
Member

gsmet commented Apr 2, 2019

I'm waiting for #1815 to get in so that the enum is not formatted as it is right now as it's barely readable.

@gsmet gsmet added this to the 0.13.0 milestone Apr 2, 2019
@machi1990
Copy link
Member Author

I'm waiting for #1815 to get in so that the enum is not formatted as it is right now as it's barely readable.

Okay. I'll rebase afterwards.

@gsmet
Copy link
Member

gsmet commented Apr 2, 2019

@machi1990 don't worry about it, I already have everything ready.

@gsmet
Copy link
Member

gsmet commented Apr 2, 2019

@machi1990 I just pushed a rebase to your branch with the new formatting. I'm waiting for CI and will merge.

Thanks a lot for this one.

@machi1990
Copy link
Member Author

@machi1990 I just pushed a rebase to your branch with the new formatting. I'm waiting for CI and will merge.

Thanks a lot for this one.

Cool. Thanks for the valuable feedback.

@Sanne
Copy link
Member

Sanne commented Apr 2, 2019

thanks @machi1990 and @gsmet ! Looks very useful

@gsmet
Copy link
Member

gsmet commented Apr 2, 2019

Merged, thanks @machi1990 !

@gsmet gsmet merged commit f79acb5 into quarkusio:master Apr 2, 2019
@machi1990 machi1990 deleted the fix-1122 branch April 2, 2019 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants