HSQLDB connection flush: safer handling when createStatement or execute fails

Change-Id: I32f3014bbf32c4a4a990bea03ee565c9b4c0164d
This commit is contained in:
Lionel Elie Mamane
2015-05-30 14:27:24 +02:00
parent 8607f8b552
commit 99c6e8dc1f

View File

@@ -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();
}
}