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

Try to reconnect at max 3x when connection is down in AbstractDatabaseEngine#getPSIterator #387

Closed
wants to merge 1 commit into from

Conversation

TiagoMSSantos
Copy link
Contributor

It was found out that sometimes the connection to the Database could be lost when calling the method AbstractDatabaseEngine#createResultIterator.
In order to make it reconnect and redo the desired query, this commit makes the method AbstractDatabaseEngine#getPSIterator call the AbstractDatabaseEngine#createResultIterator at maximum 3 times, where in each attempt, it reconnects to the database first.
By doing this, it avoids the PDB user to having to manually reconnect the connection and redo all the PreparedStatements as reported in the exception that was being thrown Connection was lost and restablished. You need to reset the prepared statement parameters and re-execute the statement.

…seEngine#getPSIterator`

It was found out that sometimes the connection to the Database could be lost
when calling the method AbstractDatabaseEngine#createResultIterator.
In order to make it reconnect and redo the desired query, this commit makes the
method AbstractDatabaseEngine#getPSIterator call the
`AbstractDatabaseEngine#createResultIterator` at maximum 3 times, where in each
attempt, it reconnects to the database first.
By doing this, it avoids the PDB user to having to manually reconnect the
connection and redo all the `PreparedStatements` as reported in the exception
that was being thrown "Connection was lost and restablished. You need to reset
the prepared statement parameters and re-execute the statement."
@TiagoMSSantos
Copy link
Contributor Author

It seems that doing this retry mechanism is unnecessary and should be done by the user of PDB instead.

@TiagoMSSantos TiagoMSSantos deleted the ft-ts-retry-getPSIterator branch June 9, 2023 09:01
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.

None yet

1 participant