From 0b01fd887a2d22f2e310c078e55ea0e24bbae847 Mon Sep 17 00:00:00 2001 From: Ocke Janssen Date: Fri, 1 Nov 2002 09:58:49 +0000 Subject: #104636# correct exception handling --- connectivity/source/drivers/jdbc/Object.cxx | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'connectivity/source/drivers/jdbc/Object.cxx') diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx index 39763c1e75..23edb7efd7 100644 --- a/connectivity/source/drivers/jdbc/Object.cxx +++ b/connectivity/source/drivers/jdbc/Object.cxx @@ -2,9 +2,9 @@ * * $RCSfile: Object.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: oj $ $Date: 2001-10-19 11:14:28 $ + * last change: $Author: oj $ $Date: 2002-11-01 10:58:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -168,14 +168,9 @@ int SDB_JRE_InitJava(const Reference& _rxFactory) // } } - catch (Exception e) + catch (Exception& e) { - if (pEnv && pEnv->ExceptionOccurred()) - { - pEnv->ExceptionDescribe(); - pEnv->ExceptionClear(); - } - + isExceptionOccured(pEnv,sal_True); result = -1; } @@ -194,25 +189,19 @@ int SDB_JRE_InitJava(const Reference& _rxFactory) SDBThreadAttach::SDBThreadAttach() : bDetach(sal_False), pEnv(NULL) { attachThread(pEnv); - if(pEnv && pEnv->ExceptionOccurred()) - pEnv->ExceptionClear(); + isExceptionOccured(pEnv,sal_True); } SDBThreadAttach::SDBThreadAttach(const Reference& _rxFactory) : bDetach(sal_False), pEnv(NULL) { attachThread(pEnv,_rxFactory); - if(pEnv && pEnv->ExceptionOccurred()) - pEnv->ExceptionClear(); + isExceptionOccured(pEnv,sal_True); } SDBThreadAttach::~SDBThreadAttach() { - if(pEnv && pEnv->ExceptionOccurred()) - { - OSL_ENSURE(0,"Exception occured in JNI!"); - pEnv->ExceptionClear(); - } - + sal_Bool bOk = isExceptionOccured(pEnv,sal_True); + OSL_ENSURE(!bOk,"Exception occured in JNI!"); detachThread(); } -- cgit v1.2.3