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

Make datbase objects AutoClosable #45

Closed
redcatbear opened this issue Nov 10, 2020 · 1 comment
Closed

Make datbase objects AutoClosable #45

redcatbear opened this issue Nov 10, 2020 · 1 comment
Labels
decision:wont-fix Acknowledged, but results in no change feature Product feature

Comments

@redcatbear
Copy link
Collaborator

Situation

In cases where you create transient database objects in test cases, you want to make sure that the are dropped after the test case.
The cleanest way to get rid of test-case-specific objects would be to initialize them in a try-with-resources and let Java clean them up. This also works if the test fails.

Acceptance Criteria

  • Database objects that support drop() also implement AutoClosable
@redcatbear redcatbear added feature Product feature decision:wont-fix Acknowledged, but results in no change labels Nov 10, 2020
@redcatbear
Copy link
Collaborator Author

After prototyping this idea, it turns out, it has the side effect of requiring users to use close() in cases where they don't use try-with-resources. This would make it necessary to wrap drop() in close() instead of the other way round and that not only breaks the existing interface, it is also awkward to read in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision:wont-fix Acknowledged, but results in no change feature Product feature
Projects
None yet
Development

No branches or pull requests

1 participant