Stored Procedure Fix, Attempt to reclose a closed cursor.
Posted: 13.08.2010, 12:52
Problem: Firebird 2.5 RC2 & 3 close the cursor on Stored Proc execution and insert / update returning statements
I have the following suggestions to fix this for firebird 2.5, but this may require some type of if statement on the FreeStatement:
Possible Solution and Seems to Work in my test environment:
For ExecProc and ExeclSQL statements add
FreeStatement (GetPlainDriver, STmntHandle, DSQL_UNPREPARE);
This needs a new constant added in FirebirdConstants
DSQL_UNPREPARE = 4
The side effects of this are apparent when the same exec procedure is called again, extra params are added to the statement -> Possible cause is in
TZabstratRODataset.SetPrepared ()
InternalPrepare is called only once then for the stored proc with current code and never reinitialised.
OR
Find out why when calling stored proc second time extra params are added ?
Some comments on this are welcome, where should I put my test code ?
I have the following suggestions to fix this for firebird 2.5, but this may require some type of if statement on the FreeStatement:
Possible Solution and Seems to Work in my test environment:
For ExecProc and ExeclSQL statements add
FreeStatement (GetPlainDriver, STmntHandle, DSQL_UNPREPARE);
This needs a new constant added in FirebirdConstants
DSQL_UNPREPARE = 4
The side effects of this are apparent when the same exec procedure is called again, extra params are added to the statement -> Possible cause is in
TZabstratRODataset.SetPrepared ()
InternalPrepare is called only once then for the stored proc with current code and never reinitialised.
OR
Find out why when calling stored proc second time extra params are added ?
Some comments on this are welcome, where should I put my test code ?