connectivity/source/drivers/firebird/Connection.hxx | 1 connectivity/source/drivers/firebird/PreparedStatement.cxx | 39 +++---- connectivity/source/drivers/firebird/ResultSet.cxx | 56 +++++------ connectivity/source/drivers/firebird/ResultSet.hxx | 2 connectivity/source/drivers/firebird/Statement.cxx | 7 - connectivity/source/drivers/firebird/StatementCommonBase.cxx | 10 - connectivity/source/drivers/firebird/StatementCommonBase.hxx | 2 dbaccess/Library_dba.mk | 6 - 8 files changed, 62 insertions(+), 61 deletions(-)
New commits: commit ca247672c53418eb46c574e8ce5eae453b1969bd Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Tue Sep 10 12:57:00 2013 +0100 Remove unneeded lines. Change-Id: Ica14f151653f57f01dfd46754b705231e8423fac diff --git a/dbaccess/Library_dba.mk b/dbaccess/Library_dba.mk index 27d2e99..3946776 100644 --- a/dbaccess/Library_dba.mk +++ b/dbaccess/Library_dba.mk @@ -20,12 +20,6 @@ $(eval $(call gb_Library_add_defs,dba,\ -DOOO_DLLIMPLEMENTATION_DBA \ )) -ifeq ($(ENABLE_FIREBIRD_SDBC),TRUE) -$(eval $(call gb_Library_add_defs,dba,\ - -DENABLE_FIREBIRD_SDBC \ -)) -endif - $(eval $(call gb_Library_use_external,dba,boost_headers)) $(eval $(call gb_Library_use_sdk_api,dba)) commit 87bd0c8c8f2b6d66c32781d5dc81e7b9029ff544 Author: Andrzej J.R. Hunt <andr...@ahunt.org> Date: Tue Sep 10 07:10:20 2013 +0100 Reintroduce Statement specific mutexes. (firebird-sdbc) This replaces the erronous Connection wide mutex. Libfbembed is multithreaded hence we don't need a connection wide mutex. Change-Id: Ifae79cdefecfe6597a535e36bda318563092bf6c diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx index 4a5c9e5..c20e6f6 100644 --- a/connectivity/source/drivers/firebird/Connection.hxx +++ b/connectivity/source/drivers/firebird/Connection.hxx @@ -167,7 +167,6 @@ namespace connectivity ::rtl::OUString getConnectionURL() const {return m_sConnectionURL;} sal_Bool isEmbedded() const {return m_bIsEmbedded;} ::rtl::OUString getUserName() const {return m_sUser;} - ::osl::Mutex& getMutex() {return m_aMutex;} isc_db_handle& getDBHandle() {return m_aDBHandle;} isc_tr_handle& getTransaction() throw(::com::sun::star::sdbc::SQLException); diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 29d0f00..d60fa28 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -66,7 +66,7 @@ OPreparedStatement::OPreparedStatement( Connection* _pConnection, void OPreparedStatement::ensurePrepared() throw (SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_aMutex); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); if (m_aStatementHandle) @@ -147,7 +147,7 @@ uno::Sequence< Type > SAL_CALL OPreparedStatement::getTypes() Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData() throw(SQLException, RuntimeException) { - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); ensurePrepared(); @@ -159,7 +159,7 @@ Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData() void SAL_CALL OPreparedStatement::close() throw(SQLException, RuntimeException) { - MutexGuard aGuard( m_pConnection->getMutex() ); + MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); OStatementCommonBase::close(); @@ -189,7 +189,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex, SAL_INFO("connectivity.firebird", "setString(" << nParameterIndex << " , " << x << ")"); - MutexGuard aGuard( m_pConnection->getMutex() ); + MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); ensurePrepared(); @@ -234,7 +234,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex, Reference< XConnection > SAL_CALL OPreparedStatement::getConnection() throw(SQLException, RuntimeException) { - MutexGuard aGuard( m_pConnection->getMutex() ); + MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); return Reference< XConnection >(m_pConnection); @@ -246,7 +246,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute() SAL_INFO("connectivity.firebird", "executeQuery(). " "Got called with sql: " << m_sSqlStatement); - MutexGuard aGuard( m_pConnection->getMutex() ); + MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); ensurePrepared(); @@ -281,6 +281,7 @@ sal_Bool SAL_CALL OPreparedStatement::execute() } m_xResultSet = new OResultSet(m_pConnection, + m_aMutex, uno::Reference< XInterface >(*this), m_aStatementHandle, m_pOutSqlda); @@ -312,7 +313,7 @@ Reference< XResultSet > SAL_CALL OPreparedStatement::executeQuery() void SAL_CALL OPreparedStatement::setNull(sal_Int32 nIndex, sal_Int32 /*nSqlType*/) throw(SQLException, RuntimeException) { - MutexGuard aGuard( m_pConnection->getMutex() ); + MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); setParameterNull(nIndex, true); @@ -323,7 +324,7 @@ void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 nIndex, sal_Bool x) { (void) nIndex; (void) x; - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_aMutex); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); // TODO: decide how to deal with bools. Probably just as a byte, although @@ -334,7 +335,7 @@ template <typename T> void OPreparedStatement::setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType) throw(SQLException, RuntimeException) { - MutexGuard aGuard( m_pConnection->getMutex() ); + MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); ensurePrepared(); @@ -437,7 +438,7 @@ void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Refer { (void) parameterIndex; (void) x; - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); } @@ -447,7 +448,7 @@ void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Refer { (void) parameterIndex; (void) x; - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); } @@ -457,7 +458,7 @@ void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Refe { (void) parameterIndex; (void) x; - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); } @@ -467,7 +468,7 @@ void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Refere { (void) parameterIndex; (void) x; - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); } @@ -480,7 +481,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, c (void) sqlType; (void) scale; checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); } // ------------------------------------------------------------------------- @@ -490,7 +491,7 @@ void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_I (void) parameterIndex; (void) sqlType; (void) typeName; - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); } @@ -500,7 +501,7 @@ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any { (void) parameterIndex; (void) x; - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); } @@ -510,7 +511,7 @@ void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequ { (void) parameterIndex; (void) x; - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); } @@ -522,7 +523,7 @@ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, (void) parameterIndex; (void) x; (void) length; - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); } @@ -533,7 +534,7 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con (void) parameterIndex; (void) x; (void) length; - ::osl::MutexGuard aGuard( m_pConnection->getMutex() ); + ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); } diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx index 5093032..cbbd4d5 100644 --- a/connectivity/source/drivers/firebird/ResultSet.cxx +++ b/connectivity/source/drivers/firebird/ResultSet.cxx @@ -54,10 +54,11 @@ using namespace ::com::sun::star::io; using namespace ::com::sun::star::util; OResultSet::OResultSet(Connection* pConnection, + ::osl::Mutex& rMutex, const uno::Reference< XInterface >& xStatement, isc_stmt_handle& aStatementHandle, XSQLDA* pSqlda) - : OResultSet_BASE(pConnection->getMutex()) + : OResultSet_BASE(rMutex) , OPropertyContainer(OResultSet_BASE::rBHelper) , m_bIsBookmarkable(false) , m_nFetchSize(1) @@ -65,6 +66,7 @@ OResultSet::OResultSet(Connection* pConnection, , m_nFetchDirection(::com::sun::star::sdbc::FetchDirection::FORWARD) , m_nResultSetConcurrency(::com::sun::star::sdbc::ResultSetConcurrency::READ_ONLY) , m_pConnection(pConnection) + , m_rMutex(rMutex) , m_xStatement(xStatement) , m_xMetaData(0) , m_pSqlda(pSqlda) @@ -113,7 +115,7 @@ OResultSet::~OResultSet() // ---- XResultSet -- Row retrieval methods ------------------------------------ sal_Int32 SAL_CALL OResultSet::getRow() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return m_currentRow; @@ -121,7 +123,7 @@ sal_Int32 SAL_CALL OResultSet::getRow() throw(SQLException, RuntimeException) sal_Bool SAL_CALL OResultSet::next() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); m_currentRow++; @@ -164,7 +166,7 @@ sal_Bool SAL_CALL OResultSet::isLast() throw(SQLException, RuntimeException) sal_Bool SAL_CALL OResultSet::isBeforeFirst() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return m_currentRow == 0; @@ -172,7 +174,7 @@ sal_Bool SAL_CALL OResultSet::isBeforeFirst() throw(SQLException, RuntimeExcepti sal_Bool SAL_CALL OResultSet::isAfterLast() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return m_bIsAfterLastRow; @@ -180,7 +182,7 @@ sal_Bool SAL_CALL OResultSet::isAfterLast() throw(SQLException, RuntimeException sal_Bool SAL_CALL OResultSet::isFirst() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return m_currentRow == 1 && !m_bIsAfterLastRow; @@ -188,7 +190,7 @@ sal_Bool SAL_CALL OResultSet::isFirst() throw(SQLException, RuntimeException) void SAL_CALL OResultSet::beforeFirst() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if (m_currentRow != 0) @@ -198,7 +200,7 @@ void SAL_CALL OResultSet::beforeFirst() throw(SQLException, RuntimeException) void SAL_CALL OResultSet::afterLast() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if (!m_bIsAfterLastRow) @@ -208,7 +210,7 @@ void SAL_CALL OResultSet::afterLast() throw(SQLException, RuntimeException) sal_Bool SAL_CALL OResultSet::first() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if (m_currentRow == 0) @@ -238,7 +240,7 @@ sal_Bool SAL_CALL OResultSet::last() throw(SQLException, RuntimeException) sal_Bool SAL_CALL OResultSet::absolute(sal_Int32 aRow) throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if (aRow > m_currentRow) @@ -256,7 +258,7 @@ sal_Bool SAL_CALL OResultSet::absolute(sal_Int32 aRow) throw(SQLException, Runti sal_Bool SAL_CALL OResultSet::relative(sal_Int32 row) throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if (row > 0) @@ -279,7 +281,7 @@ sal_Bool SAL_CALL OResultSet::relative(sal_Int32 row) throw(SQLException, Runtim void SAL_CALL OResultSet::checkColumnIndex(sal_Int32 index) throw (SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if( index < 1 || index > m_fieldCount ) @@ -291,7 +293,7 @@ void SAL_CALL OResultSet::checkColumnIndex(sal_Int32 index) void SAL_CALL OResultSet::checkRowIndex() throw (SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if((m_currentRow < 1) || m_bIsAfterLastRow) @@ -314,7 +316,7 @@ Any SAL_CALL OResultSet::queryInterface( const Type & rType ) throw(RuntimeExcep sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& rColumnName) throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); uno::Reference< XResultSetMetaData > xMeta = getMetaData(); @@ -343,7 +345,7 @@ sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& rColumnName) uno::Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { (void) columnIndex; - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return NULL; @@ -352,7 +354,7 @@ uno::Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 c uno::Reference< XInputStream > SAL_CALL OResultSet::getCharacterStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { (void) columnIndex; - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return NULL; @@ -425,7 +427,7 @@ template <typename T> T OResultSet::safelyRetrieveValue(sal_Int32 columnIndex) throw (SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); checkColumnIndex(columnIndex); @@ -437,7 +439,7 @@ T OResultSet::safelyRetrieveValue(sal_Int32 columnIndex) // ---- XRow ----------------------------------------------------------------- sal_Bool SAL_CALL OResultSet::wasNull() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return m_bWasNull; @@ -543,7 +545,7 @@ DateTime SAL_CALL OResultSet::getTimestamp(sal_Int32 nIndex) // ------------------------------------------------------------------------- uno::Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); if(!m_xMetaData.is()) @@ -554,7 +556,7 @@ uno::Reference< XResultSetMetaData > SAL_CALL OResultSet::getMetaData( ) throw( uno::Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { (void) columnIndex; - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return NULL; @@ -565,7 +567,7 @@ uno::Reference< XArray > SAL_CALL OResultSet::getArray( sal_Int32 columnIndex ) uno::Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { (void) columnIndex; - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return NULL; @@ -574,7 +576,7 @@ uno::Reference< XClob > SAL_CALL OResultSet::getClob( sal_Int32 columnIndex ) th uno::Reference< XBlob > SAL_CALL OResultSet::getBlob(sal_Int32 columnIndex) throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); ISC_QUAD* pBlobID = safelyRetrieveValue< ISC_QUAD* >(columnIndex); @@ -587,7 +589,7 @@ uno::Reference< XBlob > SAL_CALL OResultSet::getBlob(sal_Int32 columnIndex) uno::Reference< XRef > SAL_CALL OResultSet::getRef( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) { (void) columnIndex; - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return NULL; @@ -598,7 +600,7 @@ Any SAL_CALL OResultSet::getObject( sal_Int32 columnIndex, const uno::Reference< { (void) columnIndex; (void) typeMap; - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return Any(); @@ -613,7 +615,7 @@ void SAL_CALL OResultSet::close() throw(SQLException, RuntimeException) SAL_INFO("connectivity.firebird", "close()."); { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); } dispose(); @@ -623,7 +625,7 @@ void SAL_CALL OResultSet::close() throw(SQLException, RuntimeException) uno::Reference< XInterface > SAL_CALL OResultSet::getStatement() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); return m_xStatement; @@ -658,7 +660,7 @@ void SAL_CALL OResultSet::refreshRow() throw(SQLException, RuntimeException) void SAL_CALL OResultSet::cancel( ) throw(RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_rMutex); checkDisposed(OResultSet_BASE::rBHelper.bDisposed); } diff --git a/connectivity/source/drivers/firebird/ResultSet.hxx b/connectivity/source/drivers/firebird/ResultSet.hxx index 2963b65..af60875 100644 --- a/connectivity/source/drivers/firebird/ResultSet.hxx +++ b/connectivity/source/drivers/firebird/ResultSet.hxx @@ -75,6 +75,7 @@ namespace connectivity protected: Connection* m_pConnection; + ::osl::Mutex& m_rMutex; const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& m_xStatement; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSetMetaData> m_xMetaData; @@ -114,6 +115,7 @@ namespace connectivity DECLARE_SERVICE_INFO(); OResultSet(Connection* pConnection, + ::osl::Mutex& rMutex, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xStatement, isc_stmt_handle& aStatementHandle, XSQLDA* aSqlda); diff --git a/connectivity/source/drivers/firebird/Statement.cxx b/connectivity/source/drivers/firebird/Statement.cxx index 00978b7..1ed5bd2 100644 --- a/connectivity/source/drivers/firebird/Statement.cxx +++ b/connectivity/source/drivers/firebird/Statement.cxx @@ -80,7 +80,7 @@ void SAL_CALL OStatement::release() throw() void OStatement::disposeResultSet() { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_aMutex); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); OStatementCommonBase::disposeResultSet(); @@ -105,7 +105,7 @@ sal_Int32 SAL_CALL OStatement::executeUpdate(const OUString& sql) uno::Reference< XResultSet > SAL_CALL OStatement::executeQuery(const OUString& sql) throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_aMutex); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); SAL_INFO("connectivity.firebird", "executeQuery(" << sql << ")"); @@ -126,6 +126,7 @@ uno::Reference< XResultSet > SAL_CALL OStatement::executeQuery(const OUString& s SAL_WARN("connectivity.firebird", "isc_dsql_execute failed"); m_xResultSet = new OResultSet(m_pConnection, + m_aMutex, uno::Reference< XInterface >(*this), m_aStatementHandle, m_pSqlda); @@ -151,7 +152,7 @@ sal_Bool SAL_CALL OStatement::execute(const OUString& sql) uno::Reference< XConnection > SAL_CALL OStatement::getConnection() throw(SQLException, RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_aMutex); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); return (uno::Reference< XConnection >)m_pConnection; diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx index f2b669f..dfff5d7 100644 --- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx +++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx @@ -45,7 +45,7 @@ using namespace ::rtl; using namespace ::std; OStatementCommonBase::OStatementCommonBase(Connection* _pConnection) - : OStatementCommonBase_Base(_pConnection->getMutex()), + : OStatementCommonBase_Base(m_aMutex), OPropertySetHelper(OStatementCommonBase_Base::rBHelper), m_pConnection(_pConnection), m_aStatementHandle( 0 ), @@ -102,7 +102,7 @@ Sequence< Type > SAL_CALL OStatementCommonBase::getTypes( ) throw(RuntimeExcept void SAL_CALL OStatementCommonBase::cancel( ) throw(RuntimeException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_aMutex); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); // cancel the current sql statement } @@ -113,7 +113,7 @@ void SAL_CALL OStatementCommonBase::close() SAL_INFO("connectivity.firebird", "close"); { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_aMutex); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); disposeResultSet(); freeStatementHandle(); @@ -127,7 +127,7 @@ void OStatementCommonBase::prepareAndDescribeStatement(const OUString& sql, XSQLDA* pInSqlda) throw (SQLException) { - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_aMutex); freeStatementHandle(); @@ -214,7 +214,7 @@ uno::Reference< XResultSet > SAL_CALL OStatementCommonBase::getResultSet() throw { // TODO: verify we really can't support this // return uno::Reference< XResultSet >(); - MutexGuard aGuard(m_pConnection->getMutex()); + MutexGuard aGuard(m_aMutex); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); return m_xResultSet; diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.hxx b/connectivity/source/drivers/firebird/StatementCommonBase.hxx index c1af319..cabeb6b 100644 --- a/connectivity/source/drivers/firebird/StatementCommonBase.hxx +++ b/connectivity/source/drivers/firebird/StatementCommonBase.hxx @@ -53,6 +53,8 @@ namespace connectivity { protected: + ::osl::Mutex m_aMutex; + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> m_xResultSet; // The last ResultSet created // for this Statement _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits