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

Error "Attempt to reopen an open cursor" may be raised if the query handle is reused in a different transaction [CORE4313] #4636

Closed
firebird-issue-importer opened this issue Jan 5, 2014 · 6 comments

Comments

@firebird-issue-importer
Copy link

firebird-issue-importer commented Jan 5, 2014

Submitted by: @alexpotapchenko

Call sequence that demonstrates the issue:

isc_dsql_allocate_statement(status, &db, &st);
isc_start_transaction(status, &tr, 1, &db, 0, NULL);
isc_dsql_prepare(status, &tr, &st, 0, "select 1 from rdb$relations", 1, sqlda);

isc_dsql_execute(status, &tr, &st, 1, NULL);
while (isc_dsql_fetch(status, &st, 1, sqlda) == 0);

isc_commit_transaction(status, &tr);
isc_start_transaction(status, &tr, 1, &db, 0, NULL);

isc_dsql_free_statement(status, &st, DSQL_close);

-- here error is raised
isc_dsql_execute(status, &tr, &st, 1, NULL);
while (isc_dsql_fetch(status, &st, 1, sqlda) == 0);

isc_dsql_free_statement(status, &st, DSQL_drop);
isc_commit_transaction(status, &tr);

The issue is caused by the cursor not being explicitly closed before transaction commit/rollback. It worked in prior versions, but in v3.0 this sequence leads to leftover cursor pointers causing the error to be thrown.

P.S. Given the known details, I'm not sure it's the same issue as CORE3984.

Commits: adef722 FirebirdSQL/fbt-repository@96f7c0c

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 5, 2014

Modified by: @dyemanov

reporter: Dmitry Yemanov [ dimitr ] => Alexander Potapchenko [ lightfore ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 5, 2014

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 1 [ 10332 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 5, 2014

Commented by: @aafemt

Shouldn't be error raised earlier, on attempt to close already closed cursor?..

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 5, 2014

Commented by: @dyemanov

Yes, but it can be ignored by driver / application.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 22, 2015

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jan 18, 2016

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test

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