Skip to content

Commit

Permalink
0003258: DB2 support for transaction id
Browse files Browse the repository at this point in the history
  • Loading branch information
jumpmind-josh committed Oct 3, 2017
1 parent 24fcc41 commit 2503c6d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Expand Up @@ -119,7 +119,12 @@ public void createRequiredDatabaseObjects() {
@Override
public void dropRequiredDatabaseObjects() {
String transactionIdFunction = this.parameterService.getTablePrefix() + FUNCTION_TRANSACTION_ID;
uninstall(SQL_DROP_FUNCTION, transactionIdFunction);
try {
uninstall(SQL_DROP_FUNCTION, transactionIdFunction);
}
catch (Exception e) {
log.warn("Unable to uninstall function " + this.parameterService.getTablePrefix() + FUNCTION_TRANSACTION_ID);
}
}

@Override
Expand Down
Expand Up @@ -219,7 +219,14 @@ public void fillTables(String[] tableNames, Map<String,int[]> tableProperties) {
missingTableNames);
}
}
tables = Database.sortByForeignKeys(tables);
//tables = Database.sortByForeignKeys(tables);
for(Table t : tables) {
log.info("Before Table " + t.getName());
}
tables = Database.sortByForeignKeysNew(tables, getAllDbTables());
for(Table t : tables) {
log.info("Table " + t.getName());
}
buildForeignKeyReferences(tables);
buildDependentColumnValues(tables);
fillTables(tables, tableProperties);
Expand Down Expand Up @@ -365,7 +372,10 @@ private void fillTables(List<Table> tables, Map<String,int[]> tableProperties) {

List<Table> groupTables = new ArrayList<Table>();
if (cascading && dmlType == INSERT) {
groupTables.addAll(foreignTables.get(tableToProcess));
List<Table> foreignTablesList = foreignTables.get(tableToProcess);
if (foreignTablesList != null) {
groupTables.addAll(foreignTablesList);
}
if (groupTables.size() > 0) {
log.info("Cascade insert " + tableToProcess.getName() + ": " + toStringTables(groupTables));
}
Expand Down

0 comments on commit 2503c6d

Please sign in to comment.