diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-23 10:19:27 +0100 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-23 10:32:20 +0100 |
commit | 19cb39f0ffafaaa2f016035bd4ec297b87652681 (patch) | |
tree | b182b653f8b30e4cde427f96ded89580db450ff1 /connectivity | |
parent | ddc3818322b07793ae398a46d6cf9fc71f7bbff7 (diff) |
Close cursors in PreparedStatement. (firebird-sdbc)
Trying to reuse a statement that still has an open cursor leads to
errors -- in this usage isc_free_statement doesn't actually free
the statement but simply closes the db-internal cursor used by
that statement previously.
Change-Id: Iedbe42bc46e6b6f972b7b19f17a60d5f59bae28c
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/firebird/PreparedStatement.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 024c9aef88d9..ddb10e05eb60 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -265,6 +265,19 @@ sal_Bool SAL_CALL OPreparedStatement::execute() ISC_STATUS aErr; + if (m_xResultSet.is()) // Checks whether we have already run the statement. + { + disposeResultSet(); + // Closes the cursor from the last run. + aErr = isc_dsql_free_statement(m_statusVector, + &m_aStatementHandle, + DSQL_close); + if (aErr) + evaluateStatusVector(m_statusVector, + "isc_dsql_free_statement: close cursor", + *this); + } + aErr = isc_dsql_execute(m_statusVector, &m_pConnection->getTransaction(), &m_aStatementHandle, |