Skip to content

Commit

Permalink
0002226: Sql Server 2000's default schema is the user. We had hardcod…
Browse files Browse the repository at this point in the history
…ed dbo as the schema which only worked for dbowner accounts
  • Loading branch information
chenson42 committed Mar 4, 2015
1 parent fd3de37 commit d2bb25e
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 136 deletions.
Expand Up @@ -89,6 +89,11 @@ protected void setColumnToNtext(Column column) {
@Override
public boolean createOrAlterTablesIfNecessary(String... tableNames) {
boolean altered = super.createOrAlterTablesIfNecessary(tableNames);
altered |= alterLockEscalation();
return altered;
}

protected boolean alterLockEscalation () {
ISqlTemplate sqlTemplate = platform.getSqlTemplate();
String tablePrefix = getTablePrefix();
try {
Expand Down Expand Up @@ -128,12 +133,15 @@ public boolean createOrAlterTablesIfNecessary(String... tableNames) {
+ " SET (LOCK_ESCALATION = DISABLE)");
sqlTemplate.update("ALTER TABLE " + outgoingBatchTable
+ " SET (LOCK_ESCALATION = DISABLE)");
return true;
} else {
return false;
}
} catch (Exception e) {
log.warn("Failed to disable lock escalation");
log.debug("", e);
return false;
}
return altered;
}

@Override
Expand Down
Expand Up @@ -32,6 +32,11 @@ public MsSql2000SymmetricDialect(IParameterService parameterService, IDatabasePl
super(parameterService, platform);
this.triggerTemplate = new MsSql2000TriggerTemplate(this);
}

@Override
protected boolean alterLockEscalation() {
return false;
}

@Override
public void createRequiredDatabaseObjects() {
Expand Down

0 comments on commit d2bb25e

Please sign in to comment.