Skip to content

🚧 change jdbc backend logic#422

Closed
tyrasd wants to merge 14 commits into
masterfrom
oshdb-api-jdbc-backend-fetchsinglecells
Closed

🚧 change jdbc backend logic#422
tyrasd wants to merge 14 commits into
masterfrom
oshdb-api-jdbc-backend-fetchsinglecells

Conversation

@tyrasd
Copy link
Copy Markdown
Member

@tyrasd tyrasd commented Aug 13, 2021

Description

  • cells are fetched individually instead of in a single sql query
  • properly closes database resources

Corresponding issue

Was split off from #419, see #419 (comment)

Todo

Checklist

rtroilo and others added 14 commits August 13, 2021 15:36
Co-authored-by: Johannes Visintini <johannes.visintini@heigit.org>
Co-authored-by: Martin Raifer <martin.raifer@heigit.org>
Co-authored-by: Johannes Visintini <johannes.visintini@heigit.org>
* cells are fetched individually instead of in a single sql query
* properly closes database resources

see #419 (comment) for more background

This reverts commit 69f958b.
@tyrasd tyrasd added this to the release 0.8.0 milestone Aug 13, 2021
@tyrasd tyrasd changed the title change jdbc backend logic 🚧 change jdbc backend logic Aug 13, 2021
var table = entry.getKey();
var cellId = entry.getValue();
var sqlQuery = String.format("select data from %s where level = ? and id = ?", table);
try (var pstmt = ((OSHDBJdbc) this.oshdb).getConnection().prepareStatement(sqlQuery)) {
Copy link
Copy Markdown
Member Author

@tyrasd tyrasd Aug 13, 2021

Choose a reason for hiding this comment

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

@rtroilo would it make sense to store this in a shared prepared statement, instead of recreating it for every single fetching of a single grid cell (similar to how it is implemented in the tagtranslator)? or is that not possible because of concurrency issues (and if yes: could that be solved by using a connection pool instead of a single db connection)?

Base automatically changed from fix_some_sonarlint_issues to master August 14, 2021 15:49
@tyrasd tyrasd mentioned this pull request Aug 19, 2021
1 task
@tyrasd tyrasd requested a review from rtroilo October 20, 2022 12:01
@Hagellach37 Hagellach37 deleted the oshdb-api-jdbc-backend-fetchsinglecells branch October 20, 2022 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants