-
Notifications
You must be signed in to change notification settings - Fork 17
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 won't be finished after all rows are read #6
Comments
I had a similar problem. I was creating a connection, then passing it around thorough various functions, all part of one big long transaction, using "execute" and "quickQuery" mainly. Sometimes the transaction would complete, sometimes it would just hang forever, sometimes it would give me a random sqlException, and I even got a few segfaults and a core dump! The randomness made me think it had to do with either threading or garbage collection or maybe the RTS signalling problems. I was at the end of my tether -- I know I was passing around a single connection, and (even though I wasn't using threads), wrapping the connection in an MVar didn't help. I put withRTSSignalsBlocked every which where, in all combinations. No good. That left garbage collection -- maybe my statements weren't being finalized properly, and were getting randomly garbage collected and exploding? I added an explicit call to "finish" when I was done with each prepared statement, and now it works just fine. Something up here... |
I'm afraid I'm unlikely to get to this any time soon, as I don't use HDBC any more. Your best bet is to try to fix it, and issue a pull request if you get something working. |
I'll maybe have a go at it... Will indeed issue a pull request if I get it. |
I faced similar issue in my tests. A lot of unfinished statements caused segmentation fault, so I had to finish them manually everywhere. Does anyone maintain this project for now? |
@boris-stepanov I am the current maintainer. |
Even though the document of fetchRow says "Will automatically call finish when the last row is read.", it doesn't finish the statement after it reads all rows. Actually, it finishes a statement when I try to read the next row of the last row. This causes an error when I use a statement in a transaction.
For example, this code throws an exception.
The same error occurs when I call commit explicitly. Something like:
When I call fetchRow one more time, or call finish explicitly, it works fine.
The text was updated successfully, but these errors were encountered: