jl154 #i113463# some comments and rollback even when runtime exception is thrown

This commit is contained in:
Joachim Lingner
2010-07-28 16:27:07 +02:00
parent ac751d3424
commit d4853323d5
2 changed files with 14 additions and 16 deletions

View File

@@ -1136,6 +1136,14 @@ sal_Bool ExtensionManager::synchronize(
bModified |= m_bundledRepository->synchronize(xAbortChannel, xCmdEnv); bModified |= m_bundledRepository->synchronize(xAbortChannel, xCmdEnv);
progressBundled.update(OUSTR("\n\n")); progressBundled.update(OUSTR("\n\n"));
//Always determine the active extension. This is necessary for the
//first-start optimization. The setup creates the registration data for the
//bundled extensions (brand_layer/share/prereg/bundled), which is copied to the user
//installation (user_installation/extension/bundled) when a user starts OOo
//for the first time after running setup. All bundled extensions are registered
//at that moment. However, extensions with the same identifier can be in the
//shared or user repository, in which case the respective bundled extensions must
//be revoked.
try try
{ {
const uno::Sequence<uno::Sequence<Reference<deploy::XPackage> > > const uno::Sequence<uno::Sequence<Reference<deploy::XPackage> > >

View File

@@ -866,14 +866,10 @@ void BackendImpl::PackageImpl::processPackage_(
try { try {
xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv ); xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv );
} }
catch (RuntimeException &) { catch (Exception &)
throw; {
} //We even try a rollback if the user cancelled the action (CommandAbortedException)
catch (ucb::CommandAbortedException &) { //in order to prevent invalid database entries.
throw;
}
catch (Exception &) {
// CommandFailedException, DeploymentException:
Any exc( ::cppu::getCaughtException() ); Any exc( ::cppu::getCaughtException() );
// try to handle exception, notify: // try to handle exception, notify:
bool approve = false, abort = false; bool approve = false, abort = false;
@@ -904,14 +900,8 @@ void BackendImpl::PackageImpl::processPackage_(
bundle[ pos ]->revokePackage( bundle[ pos ]->revokePackage(
xSubAbortChannel, xCmdEnv ); xSubAbortChannel, xCmdEnv );
} }
catch (RuntimeException &) { catch (Exception &)
throw; {
}
catch (ucb::CommandAbortedException &) {
throw;
}
catch (Exception &) {
// bundle rollback error:
OSL_ENSURE( 0, ::rtl::OUStringToOString( OSL_ENSURE( 0, ::rtl::OUStringToOString(
::comphelper::anyToString( ::comphelper::anyToString(
::cppu::getCaughtException() ), ::cppu::getCaughtException() ),