-
Notifications
You must be signed in to change notification settings - Fork 28
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
Ensure queries respect fetch size #299
Conversation
src/main/java/com/feedzai/commons/sql/abstraction/dml/result/ResultIterator.java
Outdated
Show resolved
Hide resolved
b1b7714
to
f857dbf
Compare
src/test/java/com/feedzai/commons/sql/abstraction/engine/impl/abs/TestRouter.java
Show resolved
Hide resolved
src/main/java/com/feedzai/commons/sql/abstraction/dml/result/ResultIterator.java
Show resolved
Hide resolved
src/main/java/com/feedzai/commons/sql/abstraction/dml/result/ResultIterator.java
Outdated
Show resolved
Hide resolved
src/test/java/com/feedzai/commons/sql/abstraction/engine/impl/abs/TestRouter.java
Show resolved
Hide resolved
src/test/java/com/feedzai/commons/sql/abstraction/engine/impl/abs/TestRouter.java
Show resolved
Hide resolved
src/test/java/com/feedzai/commons/sql/abstraction/engine/impl/abs/TestRouter.java
Show resolved
Hide resolved
src/test/java/com/feedzai/commons/sql/abstraction/engine/impl/abs/TestRouter.java
Show resolved
Hide resolved
* | ||
* @author José Fidalgo (jose.fidalgo@feedzai.com) | ||
*/ | ||
public class TestRouter implements Closeable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't TestProxy
be a more appropriate name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe 😄
src/test/java/com/feedzai/commons/sql/abstraction/engine/impl/abs/AbstractEngineSchemaTest.java
Outdated
Show resolved
Hide resolved
According to the MySql support team, 8.0 doesn't have this bug. So are we planning to not support 5.1 anymore? |
I checked, and it doesn't have the bug. |
MySql 5.7 EOL will be next year(October 21, 2023) so maybe we could just support it until then and after just support 8.0 |
When querying the database with a fetch size set, some DB engines ignore that setting and get all results into memory, which might crash the client code due to out of memory, or at least cause long GC pauses.
This commit makes PostgreSQL and CockroachDB respect the fetch size, by wrapping the queries in a transaction if needed, so that a server side cursor is kept while the results are being fetched.
In the case of MySQL, server side cursors can be enabled so that it respects the fetch size, but due to bug https://bugs.mysql.com/bug.php?id=106465 this would make the driver ignore the query timeouts.