Switching bundles to Derby by default. Also removed HSQL alf_data inclusion and non-open source DBs from hibernate/repo config.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9924 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Paul Holmes-Higgin
2008-07-17 16:00:19 +00:00
parent 2c02d2a9d4
commit c73b99b209
3 changed files with 17 additions and 41 deletions

View File

@@ -33,6 +33,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Writer;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -1088,8 +1089,22 @@ public class SchemaBootstrap extends AbstractLifecycleBean
@Override
protected void onShutdown(ApplicationEvent event)
{
// NOOP
}
Configuration cfg = localSessionFactory.getConfiguration();
// Shut down DB, if required
Dialect dialect = Dialect.getDialect(cfg.getProperties());
Class dialectClazz = dialect.getClass();
if (dialectClazz.equals(DerbyDialect.class))
{
try
{
DriverManager.getConnection("jdbc:derby:;shutdown=true");
}
// Derby shutdown always triggers an exception, even when clean
catch (Throwable e)
{
}
}
}
/**
* This is a workaround for the odd Spring-Hibernate interaction during configuration.