Tag: cws_src680_dba30 User: fs Date: 05/08/22 07:54:42 Modified: /dba/dbaccess/source/core/api/ RowSet.cxx, SingleSelectQueryComposer.cxx, querycomposer.cxx /dba/dbaccess/source/ui/browser/ genericcontroller.cxx
Log: some minor speedups in the query composer, and some RTL_LOGs for #i48403# File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: RowSet.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSet.cxx?r1=1.133.12.1&r2=1.133.12.2 Delta lines: +24 -12 --------------------- --- RowSet.cxx 6 Apr 2005 07:14:11 -0000 1.133.12.1 +++ RowSet.cxx 22 Aug 2005 14:54:37 -0000 1.133.12.2 @@ -2,9 +2,9 @@ * * $RCSfile: RowSet.cxx,v $ * - * $Revision: 1.133.12.1 $ + * $Revision: 1.133.12.2 $ * - * last change: $Author: fs $ $Date: 2005/04/06 07:14:11 $ + * last change: $Author: fs $ $Date: 2005/08/22 14:54:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -211,6 +211,9 @@ #ifndef INCLUDED_SVTOOLS_SYSLOCALE_HXX #include <svtools/syslocale.hxx> #endif +#ifndef _RTL_LOGFILE_HXX_ +#include <rtl/logfile.hxx> +#endif using namespace utl; using namespace dbaccess; @@ -1637,6 +1640,8 @@ // XRowSet void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotification) { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "[EMAIL PROTECTED]", "ORowSet::execute_NoApprove_NoNewConn" ); + // now we can dispose our old connection ::comphelper::disposeComponent(m_xOldConnection); m_xOldConnection = NULL; @@ -1689,13 +1694,16 @@ ::dbtools::setObjectWithInfo(xParam,i,aIter->makeAny(),aIter->getTypeKind()); } - Reference< XResultSet> xRs = m_xStatement->executeQuery(); + Reference< XResultSet> xResults; + xResults = m_xStatement->executeQuery(); // create the composed table name ::rtl::OUString aComposedTableName; if(m_aUpdateTableName.getLength()) composeTableName(m_xActiveConnection->getMetaData(),m_aUpdateCatalogName,m_aUpdateSchemaName,m_aUpdateTableName,aComposedTableName,sal_False,::dbtools::eInDataManipulation); - m_pCache = new ORowSetCache(xRs,m_xAnalyzer,m_xServiceManager,m_aParameterRow,aComposedTableName,m_bModified,m_bNew); + { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "[EMAIL PROTECTED]", "ORowSet::execute_NoApprove_NoNewConn::createCache" ); + m_pCache = new ORowSetCache(xResults,m_xAnalyzer,m_xServiceManager,m_aParameterRow,aComposedTableName,m_bModified,m_bNew); if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) { m_nPrivileges = Privilege::SELECT; @@ -1704,6 +1712,7 @@ m_pCache->setMaxRowSize(m_nFetchSize); m_aCurrentRow = m_pCache->createIterator(); m_aOldRow = m_pCache->registerOldRow(); + } // now we can clear the parameter row m_aParameterRow.clear(); @@ -1724,6 +1733,7 @@ ::rtl::OUString aDescription; sal_Int32 nFormatKey = 0; + RTL_LOGFILE_CONTEXT_AUTHOR( aColumnCreateLog, "dbaccess", "[EMAIL PROTECTED]", "ORowSet::execute_NoApprove_NoNewConn::createColumns" ); if(!m_xColumns.is()) { // use the meta data @@ -2225,6 +2235,8 @@ //------------------------------------------------------------------------------ rtl::OUString ORowSet::getComposedQuery(const rtl::OUString& rQuery, sal_Bool bEscapeProcessing,Reference< XNameAccess >& _rxRetTables) throw( SQLException, RuntimeException ) { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "[EMAIL PROTECTED]", "ORowSet::getComposedQuery" ); + // use query composer to make a useful query with filter and/or order by part rtl::OUString aComposedStatement = rQuery; if (bEscapeProcessing) File [changed]: SingleSelectQueryComposer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/SingleSelectQueryComposer.cxx?r1=1.10.2.1&r2=1.10.2.2 Delta lines: +19 -18 --------------------- --- SingleSelectQueryComposer.cxx 6 Apr 2005 07:15:34 -0000 1.10.2.1 +++ SingleSelectQueryComposer.cxx 22 Aug 2005 14:54:38 -0000 1.10.2.2 @@ -2,9 +2,9 @@ * * $RCSfile: SingleSelectQueryComposer.cxx,v $ * - * $Revision: 1.10.2.1 $ + * $Revision: 1.10.2.2 $ * - * last change: $Author: fs $ $Date: 2005/04/06 07:15:34 $ + * last change: $Author: fs $ $Date: 2005/08/22 14:54:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -136,6 +136,9 @@ #ifndef DBACCESS_SOURCE_CORE_INC_COMPOSERTOOLS_HXX #include "composertools.hxx" #endif +#ifndef _RTL_LOGFILE_HXX_ +#include <rtl/logfile.hxx> +#endif #include <memory> using namespace dbaccess; @@ -181,6 +184,7 @@ */ const OSQLParseNode* parseStatement_throwError( OSQLParser& _rParser, const ::rtl::OUString& _rStatement, const Reference< XInterface >& _rxContext ) { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "[EMAIL PROTECTED]", "SingleSelectQueryComposer.cxx::parseStatement_throwError" ); ::rtl::OUString aErrorMsg; const OSQLParseNode* pNewSqlParseNode = _rParser.parseTree( aErrorMsg, _rStatement ); if ( !pNewSqlParseNode ) @@ -227,6 +231,7 @@ void parseAndCheck_throwError( OSQLParser& _rParser, const ::rtl::OUString& _rStatement, OSQLParseTreeIterator& _rIterator, const Reference< XInterface >& _rxContext ) { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "[EMAIL PROTECTED]", "SingleSelectQueryComposer.cxx::parseAndCheck_throwError" ); const OSQLParseNode* pNode = parseStatement_throwError( _rParser, _rStatement, _rxContext ); checkForSingleSelect_throwError( pNode, _rIterator, _rxContext, _rStatement ); } @@ -376,6 +381,7 @@ // ------------------------------------------------------------------------- void SAL_CALL OSingleSelectQueryComposer::setQuery( const ::rtl::OUString& command ) throw(SQLException, RuntimeException) { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "[EMAIL PROTECTED]", "OSingleSelectQueryComposer::setQuery" ); ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aMutex ); @@ -395,6 +401,7 @@ // ----------------------------------------------------------------------------- void OSingleSelectQueryComposer::setQuery_Impl( const ::rtl::OUString& command ) { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "[EMAIL PROTECTED]", "OSingleSelectQueryComposer::setQuery_Impl" ); // parse this parseAndCheck_throwError( m_aSqlParser, command, m_aSqlIterator, *this ); @@ -598,24 +605,25 @@ // ------------------------------------------------------------------------- void SAL_CALL OSingleSelectQueryComposer::setElementaryQuery( const ::rtl::OUString& _rElementary ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException) { + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "[EMAIL PROTECTED]", "OSingleSelectQueryComposer::setElementaryQuery" ); ::connectivity::checkDisposed(OSubComponent::rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aMutex ); - // parse and verify the statement, building a temporary iterator - OSQLParseTreeIterator aElementaryIterator( m_xTableSupplier, m_xMetaData, NULL ); - parseAndCheck_throwError( m_aSqlParser, _rElementary, aElementaryIterator, *this ); - // remember the 4 current "additive" clauses ::std::vector< ::rtl::OUString > aAdditiveClauses( SQLPartCount ); for ( SQLPart eLoopParts = Where; eLoopParts != SQLPartCount; incSQLPart( eLoopParts ) ) aAdditiveClauses[ eLoopParts ] = getSQLPart( eLoopParts, m_aAdditiveIterator, sal_False ); - // strip every filter/order/groupby/having clause, and set the pure select statement - // as query - setQuery( _rElementary ); + // clear the tables and columns + clearCurrentCollections(); + // set and parse the new query + setQuery_Impl( _rElementary ); + + // get the 4 elementary parts of the statement + for ( SQLPart eLoopParts = Where; eLoopParts != SQLPartCount; incSQLPart( eLoopParts ) ) + m_aElementaryParts[ eLoopParts ] = getSQLPart( eLoopParts, m_aSqlIterator, sal_False ); - // reset the the AdditiveIterator: m_aPureSelectSQL may have changed, and even if not, - // setQuery touched the m_aAdditiveIterator + // reset the the AdditiveIterator: m_aPureSelectSQL may have changed try { parseAndCheck_throwError( m_aSqlParser, composeStatementFromParts( aAdditiveClauses ), m_aAdditiveIterator, *this ); @@ -627,13 +635,6 @@ // every part of the additive statement should have passed other tests already, and should not // be able to cause any errors ... me thinks } - - // get the four parts of the statement - for ( SQLPart eLoopParts = Where; eLoopParts != SQLPartCount; incSQLPart( eLoopParts ) ) - m_aElementaryParts[ eLoopParts ] = getSQLPart( eLoopParts, aElementaryIterator, sal_False ); - - // temporary iterator not needed anymore - resetIterator( aElementaryIterator, true ); } // ------------------------------------------------------------------------- File [changed]: querycomposer.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/querycomposer.cxx?r1=1.61&r2=1.61.8.1 Delta lines: +9 -13 -------------------- --- querycomposer.cxx 17 Feb 2005 11:02:45 -0000 1.61 +++ querycomposer.cxx 22 Aug 2005 14:54:38 -0000 1.61.8.1 @@ -2,9 +2,9 @@ * * $RCSfile: querycomposer.cxx,v $ * - * $Revision: 1.61 $ + * $Revision: 1.61.8.1 $ * - * last change: $Author: vg $ $Date: 2005/02/17 11:02:45 $ + * last change: $Author: fs $ $Date: 2005/08/22 14:54:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -80,6 +80,9 @@ #ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATA_HPP_ #include <com/sun/star/sdbc/XResultSetMetaData.hpp> #endif +#ifndef _COM_SUN_STAR_LANG_SERVICENOTREGISTEREDEXCEPTION_HPP_ +#include <com/sun/star/lang/ServiceNotRegisteredException.hpp> +#endif #ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> #endif @@ -125,9 +128,6 @@ #ifndef DBA_HELPERCOLLECTIONS_HXX #include "HelperCollections.hxx" #endif -#ifndef DBACCESS_CORE_API_SINGLESELECTQUERYCOMPOSER_HXX -#include "SingleSelectQueryComposer.hxx" -#endif #ifndef DBACCESS_SOURCE_CORE_INC_COMPOSERTOOLS_HXX #include "composertools.hxx" #endif @@ -163,22 +163,18 @@ try { - Reference<XMultiServiceFactory> xFac(_xConnection,UNO_QUERY); + Reference< XMultiServiceFactory > xFac( _xConnection, UNO_QUERY ); if ( xFac.is() ) { m_xComposer.set( xFac->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY ); m_xComposerHelper.set( xFac->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY ); } - else - { - m_xComposer = new OSingleSelectQueryComposer(_xTableSupplier,_xConnection, _xServiceFactory ); - m_xComposerHelper = new OSingleSelectQueryComposer(_xTableSupplier,_xConnection, _xServiceFactory ); - } } catch(Exception) { } - OSL_ENSURE( m_xComposer.is(), "OQueryComposer::OQueryComposer: Composer copuld be created!" ); + if ( !m_xComposer.is() ) + throw ServiceNotRegisteredException( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER, NULL ); } // ------------------------------------------------------------------------- OQueryComposer::~OQueryComposer() Directory: /dba/dbaccess/source/ui/browser/ =========================================== File [changed]: genericcontroller.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/genericcontroller.cxx?r1=1.63.14.1&r2=1.63.14.2 Delta lines: +19 -2 -------------------- --- genericcontroller.cxx 6 Apr 2005 07:23:30 -0000 1.63.14.1 +++ genericcontroller.cxx 22 Aug 2005 14:54:39 -0000 1.63.14.2 @@ -2,9 +2,9 @@ * * $RCSfile: genericcontroller.cxx,v $ * - * $Revision: 1.63.14.1 $ + * $Revision: 1.63.14.2 $ * - * last change: $Author: fs $ $Date: 2005/04/06 07:23:30 $ + * last change: $Author: fs $ $Date: 2005/08/22 14:54:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -146,6 +146,9 @@ #ifndef _RTL_USTRING_HXX_ #include <rtl/ustring.hxx> #endif +#ifndef _RTL_LOGFILE_HXX_ +#include <rtl/logfile.hxx> +#endif #include <algorithm> using namespace ::com::sun::star::uno; @@ -720,6 +723,20 @@ // ----------------------------------------------------------------------- void OGenericUnoController::dispatch(const URL& _aURL, const Sequence< PropertyValue >& aArgs) throw(RuntimeException) { + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + // Since the fix for #123967#, the SolarMutex is not locked anymore when the framework calls into + // here. So, lock it ourself. The real solution would be to lock it only in the places + // where it's needed, but a) this might turn out difficult, since we then also need to care + // for locking in the proper order (SolarMutex and m_aMutex), and b) this would be too many places + // for the time frame of the fix. + // #i52602# / [EMAIL PROTECTED] / 2005-07-29 + +#ifdef TIMELOG + ::rtl::OString sLog( "OGenericUnoController::dispatch( '" ); + sLog += ::rtl::OString( _aURL.Main.getStr(), _aURL.Main.getLength(), osl_getThreadTextEncoding() ); + sLog += ::rtl::OString( "' )" ); + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "[EMAIL PROTECTED]", sLog.getStr() ); +#endif executeUnChecked(_aURL,aArgs); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
