diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2014-06-16 12:22:39 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2014-06-16 21:58:05 +0200 |
commit | 21f2efbe5f2e8d86a027f04370f8100c4194ee16 (patch) | |
tree | 47835e620fa168f6dfccb62b36b0363eabe59e64 /dbaccess | |
parent | 767e15343fdedffce513fd26ce17ee6003936117 (diff) |
dbaccess::ORowSet: separate impl_rebuild_throw
Used by two different callers that wanted different things.
Also, freeResources now always positions on BeforeFirst.
It is only called with _bComplete==false by execute()-related code.
Change-Id: I3e34f77ce37c239d8d3d6a8cd7514b125b049de6
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/RowSet.cxx | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 9820287e5957..4b5b5db6639c 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -560,6 +560,15 @@ void ORowSet::freeResources( bool _bComplete ) } m_aClones.clear(); + m_aBookmark = Any(); + m_bBeforeFirst = true; + m_bAfterLast = false; + m_bNew = false; + m_bModified = false; + m_bIsInsertRow = false; + m_bLastKnownRowCountFinal = false; + m_nLastKnownRowCount = 0; + if ( _bComplete ) { // the columns must be disposed before the querycomposer is disposed because @@ -588,14 +597,6 @@ void ORowSet::freeResources( bool _bComplete ) m_xStatement = NULL; m_xTypeMap = NULL; - m_aBookmark = Any(); - m_bBeforeFirst = true; - m_bAfterLast = false; - m_bNew = false; - m_bModified = false; - m_bIsInsertRow = false; - m_bLastKnownRowCountFinal = false; - m_nLastKnownRowCount = 0; if ( m_aOldRow.is() ) m_aOldRow->clearRow(); @@ -2006,8 +2007,22 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi } else // !m_bCommandFacetsDirty { - impl_rebuild_throw(_rClearForNotification); - beforeFirst(); + Reference< XResultSet > xResultSet; + if(m_bParametersDirty) + { + xResultSet = impl_prepareAndExecute_throw(); + } + else + { + xResultSet = m_xStatement->executeQuery(); + m_pCache->reset(xResultSet); + } + // let our warnings container forget the reference to the (possibly disposed) old result set + m_aWarnings.setExternalWarnings( NULL ); + // clear all current warnings + m_aWarnings.clearWarnings(); + // let the warnings container know about the new "external warnings" + m_aWarnings.setExternalWarnings( Reference< XWarningsSupplier >( xResultSet, UNO_QUERY ) ); } checkCache(); // notify the rowset listeners @@ -2732,16 +2747,8 @@ void SAL_CALL ORowSet::refreshRow( ) throw(SQLException, RuntimeException, std: void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard) { - Reference< XResultSet > xResultSet; - if(m_bParametersDirty) - { - xResultSet = impl_prepareAndExecute_throw(); - } - else - { - xResultSet = m_xStatement->executeQuery(); - m_pCache->reset(xResultSet); - } + Reference< XResultSet > xResultSet(m_xStatement->executeQuery()); + m_pCache->reset(xResultSet); m_aWarnings.setExternalWarnings( Reference< XWarningsSupplier >( xResultSet, UNO_QUERY ) ); notifyAllListeners(_rGuard); } |