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

ISPN-3937 Investigate the memory usage of JDBC cache stores when process... #2741

Closed
wants to merge 1 commit into from

Conversation

pruivo
Copy link
Member

@pruivo pruivo commented Jul 23, 2014

...ing a large result set

  • Set the result type to TYPE_FORWARD_ONLY and the concurrency to CONCUR_READ_ONLY
  • For the particular case of MySQL, setting the fetchSite to MIN_VALUE will fetch
    a single row at the time

https://issues.jboss.org/browse/ISPN-3937

@danberindei
Copy link
Member

Shouldn't we force TableManipulation.getFetchSize() to return Integer.MIN_VALUE if the dialect is MySQL? We could try to log a warning if the user configured a custom fetch size, but I don't see a really good reason to want a custom fetch size on MySQL.

@pruivo
Copy link
Member Author

pruivo commented Jul 23, 2014

@danberindei I didn't want to do that for the following reason: the db is there only for persistence and the dataset is small. IMO, this way allows the user to configure their need (it can fetch all table if hte dataset is small, or a single row for large dataset).

@danberindei
Copy link
Member

@pruivo We wouldn't have any problem if MySQL really respected the fetch size :)

I would rather not write "If you're getting an OOM, please set fetchSize to -2147483648" in the user guide, the default value should be good enough in most cases.

Ideally, the default for MySQL should be {{Integer.MIN_VALUE}}, and if the user should be able to change it if he is sure his driver supports a custom fetch size and/or his dataset is small. But the table manipulation config doesn't know anything about the DB dialect, so implementing (and documenting) this would be pretty tricky.

@pruivo
Copy link
Member Author

pruivo commented Jul 23, 2014

so, your point is to use MIN_VALUE when MySQL is used?

@danberindei
Copy link
Member

Yes, didn't I say that? :)

…essing a large result set

* Set the result type to TYPE_FORWARD_ONLY and the concurrency to CONCUR_READ_ONLY
* For the particular case of MySQL, setting the fetchSite to MIN_VALUE will fetch
a single row at the time
@pruivo
Copy link
Member Author

pruivo commented Jul 23, 2014

@danberindei sorry, to much multitask :)
PR updated!

@danberindei
Copy link
Member

Thanks Pedro, integrated!

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