Unable to reclose closed cursor in Ibconnection.pp
Original Reporter info from Mantis: zgabrovski
-
Reporter name: Zdravko Gabrovski
Original Reporter info from Mantis: zgabrovski
- Reporter name: Zdravko Gabrovski
Description:
After a new fresh upgrade from the trunk I catch a serious (for my applications) problem that comes from the modification of the method
procedure TIBConnection.FreeFldBuffers(cursor : TSQLCursor); in ibconnection.pp.
Old code is:
procedure TIBConnection.FreeFldBuffers(cursor : TSQLCursor);
begin
with cursor as TIBCursor do
begin
FreeSQLDABuffer(SQLDA);
FreeSQLDABuffer(in_SQLDA);
SetLength(FieldBinding,0);
end;
end;
The New code is:
procedure TIBConnection.FreeFldBuffers(cursor : TSQLCursor);
begin
with cursor as TIBCursor do
begin
if FSelectable and (CursorName<>'') then
begin
if isc_dsql_free_statement(@Status, @StatementHandle, DSQL_close)<>0 then <<<<<<<<<<<<<<<<< this code
CheckError('Close Cursor', Status); // Ignore this, it can already be closed.
end;
end;
end;
The problem happens when there is a Transaction commit/rollback before close of the query.
It raises "IBConnection1 : Close Cursor : -Attempt to reclose a closed cursor."
Steps to reproduce:
Please, find attached example.
Unzip in your favor folder.
Open project, compile it.
Start it.
Click button "Open"
Click button "Close"
It will raise error.
If you start the project with old version of the ibconnection.pp, there is no problem!
Mantis conversion info:
- Mantis ID: 38358
- OS: All
- OS Build: All
- Build: trunk
- Platform: All
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 48409 (#6bdd7dc3)
- Target version: 3.2.2