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

cadc-inventory-db: artifact iterator auto commit hard to grok #122

Open
pdowler opened this issue Apr 28, 2020 · 0 comments
Open

cadc-inventory-db: artifact iterator auto commit hard to grok #122

pdowler opened this issue Apr 28, 2020 · 0 comments

Comments

@pdowler
Copy link
Member

pdowler commented Apr 28, 2020

the set autocommit to false is very far removed from set autocommit to true, making it hard to analyse and prove the behaviour is correct. It violates the normal best practice of having the start trasnaction and either commit or rollback close together in the code.

Probably: refactor to merge the ArtifactIteratorQuery and the ArtifactResultSetExtractor into a single class that does both the query and the iteration. There is no good way to determine that the caller has abandoned an iterator - only code review can help - but that's the same as the best practice txn handling mentioned above.

If done right, this will provide a good example/template for other streaming query result implementations.

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

No branches or pull requests

1 participant