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

Stopping execution of query #33

Open
hhoeflin opened this issue Jan 22, 2016 · 1 comment
Open

Stopping execution of query #33

hhoeflin opened this issue Jan 22, 2016 · 1 comment

Comments

@hhoeflin
Copy link

When executing a query with RJDBC, it can't be stopped using Ctrl-C. Is there a way to stop execution? My only current work-around is to connect to the server with a second session and kill the query there ....

@s-u
Copy link
Owner

s-u commented Jan 22, 2016

In principle JDBC provides Statement.cancel(), but it is required to be run from a separate thread which is a problem since R doesn't support multi-threading. The only solution that comes to my mind at this point is to not use JDBC directly, but start a new thread for statement execution such that R is not actually calling the execute() method but instead spinning in a user loop such that you can interrupt R which then in turn checks on the other thread for the status of the statement execution and cancels it. Obviously, that would add a bit of overhead and delay for small queries (and considerable complexity and threads will be involved in every query). Thus I'm not sure it's worth the effort, but could be doable.

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

No branches or pull requests

2 participants