protected boolean existsModulesTable() throws Exception {
final boolean[] returnValue = {false};
new HibernateTxFragment(true) {
protected void txFragment(Session session) throws Exception {
Work w = new Work() {
public void execute(Connection connection) throws SQLException {
// IMPORTANT NOTE: SQL Server driver closes the previous result set. So it's very important to read the
// data from the first result set before opening a new one. If not an exception is thrown.
DatabaseMetaData metaData = connection.getMetaData();
returnValue[0] = metaData.getTables(null, null, installedModulesTable.toLowerCase(), null).next();