summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2001-05-30 13:16:09 +0000
committerOcke Janssen <oj@openoffice.org>2001-05-30 13:16:09 +0000
commitcc76966ea65832c91485b356725d697e5cef5347 (patch)
treed755f70a8e1b29c75bdb9d6b6ff6e59649dab450 /connectivity
parent4cf018df4feb126c9f84ec6622799225a4c8c1c0 (diff)
#86995# secure that the driver stays alive as conenctions exists
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/adabas/BDriver.cxx7
-rw-r--r--connectivity/source/drivers/odbc/OConnection.cxx8
-rw-r--r--connectivity/source/inc/adabas/BDriver.hxx6
-rw-r--r--connectivity/source/inc/odbc/ODriver.hxx18
4 files changed, 23 insertions, 16 deletions
diff --git a/connectivity/source/drivers/adabas/BDriver.cxx b/connectivity/source/drivers/adabas/BDriver.cxx
index 1097ab8db2e0..5890d892dd70 100644
--- a/connectivity/source/drivers/adabas/BDriver.cxx
+++ b/connectivity/source/drivers/adabas/BDriver.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: BDriver.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: oj $ $Date: 2001-05-25 13:09:28 $
+ * last change: $Author: oj $ $Date: 2001-05-30 14:16:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -331,6 +331,9 @@ void SAL_CALL ODriver::release() throw(::com::sun::star::uno::RuntimeException)
{
ODriver_BASE::release();
}
+ODriver::~ODriver()
+{
+}
// -----------------------------------------------------------------------------
void* ODriver::getOdbcFunction(sal_Int32 _nIndex) const
{
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index 39d7ccb14a6e..f749a26f5e9a 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: OConnection.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: oj $ $Date: 2001-05-21 14:30:18 $
+ * last change: $Author: oj $ $Date: 2001-05-30 14:16:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -120,6 +120,7 @@ OConnection::OConnection(const SQLHANDLE _pDriverHandle,ODBCDriver* _pDriver)
m_bUseCatalog(sal_False),
m_bUseOldDateFormat(sal_False)
{
+ m_pDriver->acquire();
ModuleContext::AddRef();
}
//-----------------------------------------------------------------------------
@@ -127,6 +128,8 @@ OConnection::~OConnection()
{
if(!isClosed( ))
close();
+ m_pDriver->release();
+ m_pDriver = NULL;
ModuleContext::ReleaseRef();
}
//-----------------------------------------------------------------------------
@@ -137,6 +140,7 @@ void SAL_CALL OConnection::release() throw(RuntimeException)
// -----------------------------------------------------------------------------
void* OConnection::getOdbcFunction(sal_Int32 _nIndex) const
{
+ OSL_ENSURE(m_pDriver,"OConnection::getOdbcFunction: m_pDriver is null!");
return m_pDriver->getOdbcFunction(_nIndex);
}
//-----------------------------------------------------------------------------
diff --git a/connectivity/source/inc/adabas/BDriver.hxx b/connectivity/source/inc/adabas/BDriver.hxx
index 8a7fc3dee9eb..3599ee3b35d6 100644
--- a/connectivity/source/inc/adabas/BDriver.hxx
+++ b/connectivity/source/inc/adabas/BDriver.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: BDriver.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: oj $ $Date: 2001-05-15 08:18:14 $
+ * last change: $Author: oj $ $Date: 2001-05-30 14:16:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,7 +99,7 @@ namespace connectivity
DECLARE_SERVICE_INFO();
ODriver();
- ~ODriver(){}
+ virtual ~ODriver();
virtual void* getOdbcFunction(sal_Int32 _nIndex) const;
// OComponentHelper
diff --git a/connectivity/source/inc/odbc/ODriver.hxx b/connectivity/source/inc/odbc/ODriver.hxx
index 5d1237ccde03..ecd49414701c 100644
--- a/connectivity/source/inc/odbc/ODriver.hxx
+++ b/connectivity/source/inc/odbc/ODriver.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ODriver.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: oj $ $Date: 2001-05-18 08:31:16 $
+ * last change: $Author: oj $ $Date: 2001-05-30 14:16:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -109,8 +109,8 @@ namespace connectivity
// OComponentHelper
virtual void SAL_CALL disposing(void);
// XInterface
- static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
- static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
+ static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
@@ -118,11 +118,11 @@ namespace connectivity
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
// XDriver
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
};
}