Skip to content

rows.close() dropping prepared statements and affecting transactions #193

@LawYeuHan

Description

@LawYeuHan

### issue description:

  1. i prepare 2 statements in the beginning using tx.prepare()
    • each statement get a statement handle eg. 1 and 2 respectively
  2. i execute statement 1 which return a row which i scan, in the package row.close() will be called automatically which drop the statement by calling stmt.close()
  3. mayb due to firebird implementations of statement handle, my prepared statement 2 in firebird has its handle moved from 2 to 1, so its handle is now 1
  4. my statement 2 still have statement handle with value of 2 in it and try executing with it, firebird couldnt find the statement and return "unexpected transaction handle" error)
  5. rollback also fail with error "op_code: -1" (not sure why)

TLDR:
-rows.close() drop my prepared statement which undo my prepared statement
-closed statements changes the statement handles of previously prepared statements

suggestion:
rows.close() shouldnt close statement with default (DSQL_drop — 2) as i want to keep the statement prepared for repeated use, in a prepared statement it should close with DSQL_close — 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions