summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorOcke.Janssen <Ocke.Janssen@oracle.com>2011-01-21 08:31:57 +0100
committerOcke.Janssen <Ocke.Janssen@oracle.com>2011-01-21 08:31:57 +0100
commitd1f40e7742499d578b2079b947042e9232fcbc38 (patch)
treecfbf09f9c3f975722c860f333c710d9c8e308fe1 /connectivity
parent3b949fc2510279cb277f651d3b0b9976cbd1c5b6 (diff)
dba34d: #i112014# flush connection when ooo terminate
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/hsqldb/HDriver.cxx18
-rw-r--r--connectivity/source/drivers/hsqldb/HTerminateListener.cxx1
-rw-r--r--connectivity/source/inc/hsqldb/HDriver.hxx1
3 files changed, 20 insertions, 0 deletions
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index a0b755c107c9..3760b914cc1d 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/lang/Locale.hpp>
+#include <com/sun/star/util/XFlushable.hpp>
#include "HTerminateListener.hxx"
#include "hsqldb/HCatalog.hxx"
#include "diagnose_ex.h"
@@ -70,6 +71,7 @@ namespace connectivity
using namespace ::com::sun::star::embed;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::task;
+ using namespace ::com::sun::star::util;
using namespace ::com::sun::star::reflection;
namespace hsqldb
@@ -616,6 +618,22 @@ namespace connectivity
m_bInShutDownConnections = sal_True;
}
//------------------------------------------------------------------
+ void ODriverDelegator::flushConnections()
+ {
+ TWeakPairVector::iterator aEnd = m_aConnections.end();
+ for (TWeakPairVector::iterator i = m_aConnections.begin(); aEnd != i; ++i)
+ {
+ try
+ {
+ Reference<XFlushable> xCon(i->second.second.first.get(),UNO_QUERY);
+ xCon->flush();
+ }
+ catch(Exception&)
+ {
+ }
+ }
+ }
+ //------------------------------------------------------------------
void SAL_CALL ODriverDelegator::preCommit( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
::osl::MutexGuard aGuard(m_aMutex);
diff --git a/connectivity/source/drivers/hsqldb/HTerminateListener.cxx b/connectivity/source/drivers/hsqldb/HTerminateListener.cxx
index c386334acd70..52d53fa99227 100644
--- a/connectivity/source/drivers/hsqldb/HTerminateListener.cxx
+++ b/connectivity/source/drivers/hsqldb/HTerminateListener.cxx
@@ -51,6 +51,7 @@ throw( RuntimeException )
void SAL_CALL OConnectionController::queryTermination( const EventObject& /*aEvent*/ )
throw( TerminationVetoException, RuntimeException )
{
+ m_pDriver->flushConnections();
}
void SAL_CALL OConnectionController::notifyTermination( const EventObject& /*aEvent*/ )
diff --git a/connectivity/source/inc/hsqldb/HDriver.hxx b/connectivity/source/inc/hsqldb/HDriver.hxx
index 72d21d5774e1..33be38e8de48 100644
--- a/connectivity/source/inc/hsqldb/HDriver.hxx
+++ b/connectivity/source/inc/hsqldb/HDriver.hxx
@@ -123,6 +123,7 @@ namespace connectivity
virtual void SAL_CALL reverted( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
void shutdownConnections();
+ void flushConnections();
protected:
/// dtor
virtual ~ODriverDelegator();