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

Statement handles aren't cleaned up leading to max_prepared_stmt_count exception #7

Open
pbennett opened this issue Dec 13, 2011 · 3 comments

Comments

@pbennett
Copy link

rdbi doesn't appear to actually clean up the prepared statements it creates when results are fetched. It's trivial to get this error when running a process which has to run a lot of independent queries in a long running process.
Error in query - exception:Can't create more than max_prepared_stmt_count statements (current value: 16382).

In dbi, you have select_one (for the extremely common, fetch xxx,yyy where id = xx case) and select_all for the other common case. RDBI has a more flexible fetch mechanism. Fine. However, rdbi never cleans up the prepared statement it creates for every execution!

If you're saying that something as trivial as this in dbi:
rows = db.select_all('select xxxx where ...', xx, yyy)

Must be turned into:
res = db.execute('select xxxx where ...', xx, yyy)
rows = res.fetch(:all)
res.finish
in RDBI then I would argue RDBI has a very serious problem.

@pilcrow
Copy link
Member

pilcrow commented Dec 13, 2011

Thanks, pbennett. What version of RDBI?

@pbennett
Copy link
Author

rdbi (0.9.1)
rdbi-driver-mysql (0.9.2)

@pbennett
Copy link
Author

"...then I would argue RDBI has a very serious problem."

[or at least in need of other apis that allow easy single and full fetches that don't leak prepared statement handles :D]

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

No branches or pull requests

2 participants