diff options
-rw-r--r-- | connectivity/source/drivers/firebird/Driver.cxx | 17 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Driver.hxx | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx index 2b9e65677ddb..89c9cfd08125 100644 --- a/connectivity/source/drivers/firebird/Driver.cxx +++ b/connectivity/source/drivers/firebird/Driver.cxx @@ -26,6 +26,8 @@ #include "resource/sharedresources.hxx" #include <comphelper/processfactory.hxx> +#include <osl/process.h> +#include <osl/file.hxx> using namespace com::sun::star; using namespace com::sun::star::uno; @@ -52,9 +54,21 @@ namespace connectivity } } +// Static const member variables +const OUString FirebirdDriver::our_sFirebirdTmpVar("FIREBIRD_TMP"); +const OUString FirebirdDriver::our_sFirebirdLockVar("FIREBIRD_LOCK"); + FirebirdDriver::FirebirdDriver() : ODriver_BASE(m_aMutex) { + OUString sTmpDir; + ::osl::FileBase::getTempDirURL(sTmpDir); + + // Overrides firebird's default of /tmp or c:\temp + osl_setEnvironment(our_sFirebirdTmpVar.pData, sTmpDir.pData); + // Overrides firebird's default of /tmp/firebird or c:\temp\firebird + sTmpDir += "/firebird"; + osl_setEnvironment(our_sFirebirdLockVar.pData, sTmpDir.pData); } void FirebirdDriver::disposing() @@ -70,6 +84,9 @@ void FirebirdDriver::disposing() } m_xConnections.clear(); + osl_clearEnvironment(our_sFirebirdTmpVar.pData); + osl_clearEnvironment(our_sFirebirdLockVar.pData); + ODriver_BASE::disposing(); } diff --git a/connectivity/source/drivers/firebird/Driver.hxx b/connectivity/source/drivers/firebird/Driver.hxx index 545d98ac714b..096346817f78 100644 --- a/connectivity/source/drivers/firebird/Driver.hxx +++ b/connectivity/source/drivers/firebird/Driver.hxx @@ -44,6 +44,10 @@ namespace connectivity class FirebirdDriver : public ODriver_BASE { + private: + static const ::rtl::OUString our_sFirebirdTmpVar; + static const ::rtl::OUString our_sFirebirdLockVar; + protected: ::osl::Mutex m_aMutex; // mutex is need to control member access OWeakRefArray m_xConnections; // vector containing a list |