private void forceConnection(SchemaUpdate export, Connection connection) {
try {
Class<?> cl = Class.forName("org.hibernate.tool.hbm2ddl.SuppliedConnectionHelper");
Constructor<?> constructor = cl.getConstructor(Connection.class);
constructor.setAccessible(true);
Object connectionHelper = constructor.newInstance(connection);
Field field = SchemaUpdate.class.getDeclaredField("connectionHelper");
field.setAccessible(true);
field.set(export, connectionHelper);
} catch (Exception e) {
logger.warn("Could not force connection on database update");
}
}