diff options
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/firebird/Connection.cxx | 16 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Connection.hxx | 4 |
2 files changed, 9 insertions, 11 deletions
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index d719b853cab9..9f5b00373734 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -149,10 +149,12 @@ void OConnection::construct(const ::rtl::OUString& url, const Sequence< Property bIsNewDatabase = !m_xEmbeddedStorage->hasElements(); - m_sURL = utl::TempFile::CreateTempName(); + m_pExtractedFDBFile.reset(new ::utl::TempFile(NULL, true)); + m_pExtractedFDBFile->EnableKillingFile(); + m_sURL = m_pExtractedFDBFile->GetFileName() + "/firebird.fdb"; + + SAL_INFO("connectivity.firebird", "Temporary .fdb location: " << m_sURL); - SAL_INFO("connectivity.firebird", "Temporary .fdb location: " - << OUStringToOString(m_sURL,RTL_TEXTENCODING_UTF8 ).getStr()); if (!bIsNewDatabase) { SAL_INFO("connectivity.firebird", "Extracting .fdb from .odb" ); @@ -746,14 +748,6 @@ void OConnection::disposing() evaluateStatusVector(status, "isc_detach_database", *this); } // TODO: write to storage again? - if (m_bIsEmbedded) - { - uno::Reference< ucb::XSimpleFileAccess > xFileAccess( - ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext()), - uno::UNO_QUERY); - if (xFileAccess->exists(m_sURL)) - xFileAccess->kill(m_sURL); - } dispose_ChildImpl(); cppu::WeakComponentImplHelperBase::disposing(); diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx index 7a21acad0110..21da127a01da 100644 --- a/connectivity/source/drivers/firebird/Connection.hxx +++ b/connectivity/source/drivers/firebird/Connection.hxx @@ -25,12 +25,14 @@ #include <ibase.h> +#include <boost/scoped_ptr.hpp> #include <connectivity/CommonTools.hxx> #include <connectivity/OSubComponent.hxx> #include <cppuhelper/compbase4.hxx> #include <cppuhelper/weakref.hxx> #include <map> #include <OTypeInfo.hxx> +#include <unotools/tempfile.hxx> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/document/DocumentEvent.hpp> @@ -74,6 +76,8 @@ namespace connectivity ::osl::Mutex& getMutex() { return m_aMutex; } protected: + ::boost::scoped_ptr< ::utl::TempFile > m_pExtractedFDBFile; + static const OUString sDBLocation; // Location within .odb container //==================================================================== // Data attributes |