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

Call of stored procedures gives Commands out of sync error #134

Closed
vanhry opened this issue Jul 13, 2022 · 3 comments
Closed

Call of stored procedures gives Commands out of sync error #134

vanhry opened this issue Jul 13, 2022 · 3 comments

Comments

@vanhry
Copy link

vanhry commented Jul 13, 2022

Hello everyone!
I have a lot of stored procedures call in my code. Now I am going to switch to pool library instead of regular DBI calls.
And I faced with the problem. The first run of code below works fine, but the second one gives me an error.

Error: Commands out of sync; you can't run this command now [2014]

My code that executes several times

query <- sqlInterpolate(con, "CALL GetInfo(?);", user)
df_result <- dbGetQuery(con, query)

Code with poolCheckout and poolReturn gives me the same error after first successful call

con_pool <- poolCheckout(con)
query <- sqlInterpolate(con_pool, "CALL GetInfo(?);", user)
df_result <- dbGetQuery(con_pool, query)
poolReturn(con_pool)

global initialization of pool in global.R:

con <- dbPool(drv=RMariaDB::MariaDB,
                        ...)
onStop(function() {
  poolClose(con)
})

I will appreciate any help from your side!

@vanhry vanhry changed the title Stored procedures call give Commands out of sync error Call of stored procedures gives Commands out of sync error Jul 13, 2022
@vanhry vanhry changed the title Call of stored procedures gives Commands out of sync error Call of stored procedures gives Commands out of sync error Jul 13, 2022
@vanhry
Copy link
Author

vanhry commented Jul 13, 2022

I found the solution only for RMySQL (which deprecated and I don't want to use it) solution link

Here you can find similar issue in RMariaDB, and actually, I guess my problem more related to RMariaDB package
RMariaDB issue

@vanhry
Copy link
Author

vanhry commented Jul 13, 2022

Reproducible example here

@jcheng5
Copy link
Member

jcheng5 commented Aug 26, 2022

Yeah, this seems not solvable from pool. I made a comment on the RMariaDB issue.

@jcheng5 jcheng5 closed this as completed Aug 26, 2022
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