From 99c6e8dc1fdabcc5af24a7a3cc8ff510140b0c94 Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Sat, 30 May 2015 14:27:24 +0200 Subject: HSQLDB connection flush: safer handling when createStatement or execute fails Change-Id: I32f3014bbf32c4a4a990bea03ee565c9b4c0164d --- connectivity/source/drivers/hsqldb/HConnection.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx index 562fc493b579..16b537843d44 100644 --- a/connectivity/source/drivers/hsqldb/HConnection.cxx +++ b/connectivity/source/drivers/hsqldb/HConnection.cxx @@ -150,10 +150,17 @@ namespace connectivity { namespace hsqldb m_bReadOnly = true; } } - if ( !m_bReadOnly ) + try { - Reference< XStatement > xStmt( m_xConnection->createStatement(), UNO_QUERY_THROW ); - xStmt->execute( OUString( "CHECKPOINT DEFRAG" ) ); + if ( !m_bReadOnly ) + { + Reference< XStatement > xStmt( m_xConnection->createStatement(), UNO_QUERY_THROW ); + xStmt->execute( OUString( "CHECKPOINT DEFRAG" ) ); + } + } + catch(const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); } } -- cgit