Kaydet (Commit) 19cb39f0 authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

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
üst ddc38183
...@@ -265,6 +265,19 @@ sal_Bool SAL_CALL OPreparedStatement::execute() ...@@ -265,6 +265,19 @@ sal_Bool SAL_CALL OPreparedStatement::execute()
ISC_STATUS aErr; 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, aErr = isc_dsql_execute(m_statusVector,
&m_pConnection->getTransaction(), &m_pConnection->getTransaction(),
&m_aStatementHandle, &m_aStatementHandle,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment