Skip to content

Commit

Permalink
0004943: Pulled changes into 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-miller-jumpmind committed Oct 22, 2021
2 parents 206316a + 380490e commit f51b68f
Show file tree
Hide file tree
Showing 12 changed files with 492 additions and 739 deletions.
Expand Up @@ -200,7 +200,6 @@ public void saveJob(JobDefinition job) {
if (sqlTemplate.update(getSql("updateJobSql"), args) <= 0) {
sqlTemplate.update(getSql("insertJobSql"), args);
}
restartJobs();
}

@Override
Expand All @@ -210,6 +209,5 @@ public void removeJob(String name) {
} else {
throw new SymmetricException("Failed to remove job " + name + ". Note that BUILT_IN jobs cannot be removed.");
}
restartJobs();
}
}

Large diffs are not rendered by default.

Expand Up @@ -102,7 +102,6 @@ private ParameterConstants() {
public final static String REGISTRATION_NUMBER_OF_ATTEMPTS = "registration.number.of.attempts";
public final static String REGISTRATION_REOPEN_USE_SAME_PASSWORD = "registration.reopen.use.same.password";
public final static String REGISTRATION_REQUIRE_NODE_GROUP_LINK = "registration.require.node.group.link";
public final static String REGISTRATION_REINITIALIZE_ENABLED = "registration.reinitialize.enable";
public final static String REGISTRATION_REQUIRE_INITIAL_LOAD = "registration.require.initial.load";
public final static String REGISTRATION_URL = "registration.url";
public final static String SYNC_URL = "sync.url";
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Expand Up @@ -126,4 +126,6 @@ public List<OutgoingBatch> listOutgoingBatchesWithLimit(int offset, int limit, L
public void copyOutgoingBatches(String channelId, long startBatchId, String fromNodeId, String toNodeId);

public List<Long> getAllBatches();

public List<OutgoingBatch> getBatchesInProgress();
}
Expand Up @@ -199,6 +199,8 @@ public String getTriggerName(DataEventType dml, int maxTriggerNameLength, Trigge
public void syncTriggers(List<Trigger> triggers, ITriggerCreationListener listener, boolean force, boolean verifyInDatabase);

public void syncTriggers(Table table, boolean genAlways);

public void syncTriggers(List<Table> tables, boolean genAlways);

public void dropTriggers(TriggerHistory history);

Expand Down
Expand Up @@ -753,6 +753,12 @@ public List<Long> getAllBatches() {
return sqlTemplateDirty.query(getSql("getAllBatchesSql"), new LongMapper());
}

@Override
public List<OutgoingBatch> getBatchesInProgress() {
return sqlTemplateDirty.query(getSql("selectOutgoingBatchPrefixSql", "whereInProgressStatusSql"), new OutgoingBatchMapper(true),
Status.ER.name(), Status.LD.name(), Status.QY.name(), Status.RS.name(), Status.SE.name());
}

static class OutgoingBatchSummaryMapper implements ISqlRowMapper<OutgoingBatchSummary> {
boolean withNode = false;
boolean withChannel = false;
Expand Down
Expand Up @@ -164,5 +164,6 @@ public OutgoingBatchServiceSqlMap(IDatabasePlatform platform,
+ " (select batch_id, ?, channel_id, 'NE', load_id, extract_job_flag, load_flag, common_flag, reload_row_count, other_row_count, "
+ " last_update_hostname, current_timestamp, create_time, 'copy' from $(outgoing_batch) where node_id=? and channel_id=? and batch_id > ?) ");
putSql("getAllBatchesSql", "select batch_id from $(outgoing_batch)");
putSql("whereInProgressStatusSql", "where status in (?, ?, ?, ?, ?) ");
}
}
Expand Up @@ -24,6 +24,7 @@

import java.sql.Types;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
Expand Down Expand Up @@ -53,7 +54,6 @@
import org.jumpmind.db.sql.ISqlTransaction;
import org.jumpmind.db.sql.Row;
import org.jumpmind.symmetric.ISymmetricEngine;
import org.jumpmind.symmetric.SymmetricException;
import org.jumpmind.symmetric.Version;
import org.jumpmind.symmetric.common.Constants;
import org.jumpmind.symmetric.common.ParameterConstants;
Expand Down Expand Up @@ -1547,34 +1547,37 @@ private boolean containsExactMatchForSourceTableName(Table table, List<Trigger>
}

public void syncTriggers(Table table, boolean force) {
syncTriggers(Arrays.asList(table), force);
}

public void syncTriggers(List<Table> tables, boolean force) {
boolean ignoreCase = this.parameterService.is(ParameterConstants.DB_METADATA_IGNORE_CASE);
if (table == null) {
throw new SymmetricException("'table' cannot be null, check that the table exists.");
}
/* Re-lookup just in case the table was just altered */
table = platform.getTableFromCache(table.getCatalog(), table.getSchema(), table.getName(), true);
List<Trigger> triggersForCurrentNode = getTriggersForCurrentNode();
List<TriggerHistory> activeTriggerHistories = getActiveTriggerHistories();
Map<String, List<TriggerTableSupportingInfo>> triggerToTableSupportingInfo = getTriggerToTableSupportingInfo(triggersForCurrentNode,
activeTriggerHistories, true);
for (Trigger trigger : triggersForCurrentNode) {
if (trigger.matches(table, platform.getDefaultCatalog(), platform.getDefaultSchema(), ignoreCase) &&
(!trigger.isSourceTableNameWildCarded() || !trigger.isSourceTableNameExpanded()
|| !containsExactMatchForSourceTableName(table, triggersForCurrentNode, ignoreCase))) {
List<TriggerTableSupportingInfo> triggerTableSupportingInfoList = triggerToTableSupportingInfo.get(trigger.getTriggerId());
TriggerTableSupportingInfo triggerTableSupportingInfo = null;
for (TriggerTableSupportingInfo t : triggerTableSupportingInfoList) {
if (t.getTable().getFullyQualifiedTableName().equals(table.getFullyQualifiedTableName())) {
triggerTableSupportingInfo = t;
break;
for (Table table : tables) {
/* Re-lookup just in case the table was just altered */
table = platform.getTableFromCache(table.getCatalog(), table.getSchema(), table.getName(), true);
for (Trigger trigger : triggersForCurrentNode) {
if (trigger.matches(table, platform.getDefaultCatalog(), platform.getDefaultSchema(), ignoreCase) &&
(!trigger.isSourceTableNameWildCarded() || !trigger.isSourceTableNameExpanded()
|| !containsExactMatchForSourceTableName(table, triggersForCurrentNode, ignoreCase))) {
List<TriggerTableSupportingInfo> triggerTableSupportingInfoList = triggerToTableSupportingInfo.get(trigger.getTriggerId());
TriggerTableSupportingInfo triggerTableSupportingInfo = null;
for (TriggerTableSupportingInfo t : triggerTableSupportingInfoList) {
if (t.getTable().getFullyQualifiedTableName().equals(table.getFullyQualifiedTableName())) {
triggerTableSupportingInfo = t;
break;
}
}
if (triggerTableSupportingInfo != null) {
log.info("Synchronizing triggers for {}", table.getFullyQualifiedTableName());
updateOrCreateDatabaseTriggers(trigger, table, null, force, true, activeTriggerHistories, triggerTableSupportingInfo);
log.info("Done synchronizing triggers for {}", table.getFullyQualifiedTableName());
} else {
log.warn("Can't find table {} for trigger {}, make sure table exists.", table.getFullyQualifiedTableName(), trigger.getTriggerId());
}
}
if (triggerTableSupportingInfo != null) {
log.info("Synchronizing triggers for {}", table.getFullyQualifiedTableName());
updateOrCreateDatabaseTriggers(trigger, table, null, force, true, activeTriggerHistories, triggerTableSupportingInfo);
log.info("Done synchronizing triggers for {}", table.getFullyQualifiedTableName());
} else {
log.warn("Can't find table {} for trigger {}, make sure table exists.", table.getFullyQualifiedTableName(), trigger.getTriggerId());
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions symmetric-core/src/main/resources/symmetric-default.properties
Expand Up @@ -754,17 +754,6 @@ registration.number.of.attempts=-1
# Type: boolean
registration.reopen.use.same.password=true

# Indicates whether SymmetricDS should be re-initialized immediately before registration.
# When a client is successful with its registration, it will un-install its database
# objects (sym triggers, tables, and procedures), then re-install its database objects
# and load the configuration received from registration.
#
# DatabaseOverridable: true
# Tags: registration
# Type: boolean
registration.reinitialize.enable=false


# When this is set to true a node will have to have had an initial load prior to allowing other nodes to register with it
#
# DatabaseOverridable: true
Expand Down
96 changes: 48 additions & 48 deletions symmetric-jdbc/src/test/resources/db-test.properties
Expand Up @@ -27,9 +27,9 @@ test.client2=h2
mysql.db.driver=com.mysql.jdbc.Driver
mysql.db.user=root
mysql.db.password=admin
mysql.root.db.url=jdbc:mysql://dbdev2.loc/SymmetricRoot?tinyInt1isBit=false
mysql.server.db.url=jdbc:mysql://dbdev2.loc/SymmetricRoot?tinyInt1isBit=false
mysql.client.db.url=jdbc:mysql://dbdev2.loc/SymmetricClient?tinyInt1isBit=false
mysql.root.db.url=jdbc:mysql://localhost/SymmetricRoot?tinyInt1isBit=false
mysql.server.db.url=jdbc:mysql://localhost/SymmetricRoot?tinyInt1isBit=false
mysql.client.db.url=jdbc:mysql://localhost/SymmetricClient?tinyInt1isBit=false

mariadb.db.driver=org.mariadb.jdbc.Driver
mariadb.db.user=root
Expand All @@ -41,9 +41,9 @@ mariadb.client.db.url=jdbc:mysql://localhost/SymmetricClient?tinyInt1isBit=false
nuodb.db.driver=com.nuodb.jdbc.Driver
nuodb.db.user=root
nuodb.db.password=admin
nuodb.root.db.url=jdbc:com.nuodb://dbdev2.loc/SymmetricRoot?schema=SymmetricRoot
nuodb.server.db.url=jdbc:com.nuodb://dbdev2.loc/SymmetricRoot?schema=SymmetricRoot
nuodb.client.db.url=jdbc:com.nuodb://dbdev2.loc/SymmetricClient?schema=SymmetricClient
nuodb.root.db.url=jdbc:com.nuodb://localhost/SymmetricRoot?schema=SymmetricRoot
nuodb.server.db.url=jdbc:com.nuodb://localhost/SymmetricRoot?schema=SymmetricRoot
nuodb.client.db.url=jdbc:com.nuodb://localhost/SymmetricClient?schema=SymmetricClient

oracle.db.driver=oracle.jdbc.driver.OracleDriver
oracle.server.db.user=SymmetricRoot
Expand All @@ -52,8 +52,8 @@ oracle.root.db.user=SymmetricRoot
oracle.root.db.password=admin
oracle.client.db.user=SymmetricClient
oracle.client.db.password=admin
oracle.db.url=jdbc:oracle:thin:@dbdev2.loc:1521:XE
oracle.bulk.load.sqlldr.cmd=/usr/local/instantclient_18_3/sqlldr
oracle.db.url=jdbc:oracle:thin:@localhost:1521:XE
oracle.bulk.load.sqlldr.cmd=/usr/local/instantclient/sqlldr

derby.db.driver=org.apache.derby.jdbc.EmbeddedDriver
derby.db.user=
Expand All @@ -80,53 +80,53 @@ h2.client2.db.url=jdbc:h2:file:target/clientdbs/client2
mssql.db.driver=net.sourceforge.jtds.jdbc.Driver
mssql.db.user=sa
mssql.db.password=Admin123
mssql.root.db.url=jdbc:jtds:sqlserver://win2008dev.loc/SymmetricRoot;loginTimeout=120;sendStringParametersAsUnicode=false;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880;socketTimeout=300;appName=junit
mssql.server.db.url=jdbc:jtds:sqlserver://win2008dev.loc/SymmetricRoot;loginTimeout=120;sendStringParametersAsUnicode=false;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880;socketTimeout=300;appName=junit
mssql.client.db.url=jdbc:jtds:sqlserver://win2008dev.loc/SymmetricClient;loginTimeout=120;sendStringParametersAsUnicode=false;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880;socketTimeout=300;appName=junit
mssql.root.db.url=jdbc:jtds:sqlserver://localhost/SymmetricRoot;loginTimeout=120;sendStringParametersAsUnicode=false;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880;socketTimeout=300;appName=junit
mssql.server.db.url=jdbc:jtds:sqlserver://localhost/SymmetricRoot;loginTimeout=120;sendStringParametersAsUnicode=false;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880;socketTimeout=300;appName=junit
mssql.client.db.url=jdbc:jtds:sqlserver://localhost/SymmetricClient;loginTimeout=120;sendStringParametersAsUnicode=false;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880;socketTimeout=300;appName=junit

mssql2000.db.driver=net.sourceforge.jtds.jdbc.Driver
mssql2000.db.user=sa
mssql2000.db.password=admin123
mssql2000.root.db.url=jdbc:jtds:sqlserver://winxpdev.loc/SymmetricRoot;loginTimeout=120
mssql2000.server.db.url=jdbc:jtds:sqlserver://winxpdev.loc/SymmetricRoot;loginTimeout=120
mssql2000.client.db.url=jdbc:jtds:sqlserver://winxpdev.loc/SymmetricClient;loginTimeout=120
mssql2000.root.db.url=jdbc:jtds:sqlserver://localhost/SymmetricRoot;loginTimeout=120
mssql2000.server.db.url=jdbc:jtds:sqlserver://localhost/SymmetricRoot;loginTimeout=120
mssql2000.client.db.url=jdbc:jtds:sqlserver://localhost/SymmetricClient;loginTimeout=120


sqlserver.db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
sqlserver.db.user=sa
sqlserver.db.password=Admin123
sqlserver.root.db.url=jdbc:sqlserver://win2008dev.loc;databasename=SymmetricRoot;loginTimeout=120
sqlserver.server.db.url=jdbc:sqlserver://win2008dev.loc;databasename=SymmetricRoot;loginTimeout=120
sqlserver.client.db.url=jdbc:sqlserver://win2008dev.loc;databasename=SymmetricClient;loginTimeout=120
sqlserver.root.db.url=jdbc:sqlserver://localhost;databasename=SymmetricRoot;loginTimeout=120
sqlserver.server.db.url=jdbc:sqlserver://localhost;databasename=SymmetricRoot;loginTimeout=120
sqlserver.client.db.url=jdbc:sqlserver://localhost;databasename=SymmetricClient;loginTimeout=120

firebird.db.driver=org.firebirdsql.jdbc.FBDriver
firebird.db.user=sysdba
firebird.db.password=masterkey
firebird.root.db.url=jdbc:firebirdsql://dbdev1.loc:3070//var/lib/firebird/data/SymmetricRoot
firebird.server.db.url=jdbc:firebirdsql://dbdev1.loc:3070//var/lib/firebird/data/SymmetricRoot
firebird.client.db.url=jdbc:firebirdsql://dbdev1.loc:3070//var/lib/firebird/data/SymmetricClient
firebird.root.db.url=jdbc:firebirdsql://localhost:3070//var/lib/firebird/data/SymmetricRoot
firebird.server.db.url=jdbc:firebirdsql://localhost:3070//var/lib/firebird/data/SymmetricRoot
firebird.client.db.url=jdbc:firebirdsql://localhost:3070//var/lib/firebird/data/SymmetricClient

interbase.db.driver=interbase.interclient.Driver
interbase.db.user=sysdba
interbase.db.password=masterkey
interbase.root.db.url=jdbc:interbase://dbdev1.loc:3050//opt/interbase/data/symmetricroot.ib
interbase.server.db.url=jdbc:interbase://dbdev1.loc:3050//opt/interbase/data/symmetricroot.ib
interbase.client.db.url=jdbc:interbase://dbdev1.loc:3050//opt/interbase/data/symmetricclient.ib
interbase.root.db.url=jdbc:interbase://localhost:3050//opt/interbase/data/symmetricroot.ib
interbase.server.db.url=jdbc:interbase://localhost:3050//opt/interbase/data/symmetricroot.ib
interbase.client.db.url=jdbc:interbase://localhost:3050//opt/interbase/data/symmetricclient.ib

postgres.db.driver=org.postgresql.Driver
postgres.db.user=postgres
postgres.db.password=admin

postgres.root.db.url=jdbc:postgresql://dbdev1.loc/symmetricroot?stringtype=unspecified
postgres.server.db.url=jdbc:postgresql://dbdev1.loc/symmetricroot?stringtype=unspecified
postgres.client.db.url=jdbc:postgresql://dbdev1.loc/symmetricclient?stringtype=unspecified
postgres.root.db.url=jdbc:postgresql://localhost/symmetricroot?stringtype=unspecified
postgres.server.db.url=jdbc:postgresql://localhost/symmetricroot?stringtype=unspecified
postgres.client.db.url=jdbc:postgresql://localhost/symmetricclient?stringtype=unspecified

db2.db.driver=com.ibm.db2.jcc.DB2Driver
db2.db.user=db2inst1
db2.db.password=admin
db2.server.db.url=jdbc:db2://dbdev1.loc:50000/symroot
db2.root.db.url=jdbc:db2://dbdev1.loc:50000/symroot
db2.client.db.url=jdbc:db2://dbdev1.loc:50000/symclien
db2.server.db.url=jdbc:db2://localhost:50000/symroot
db2.root.db.url=jdbc:db2://localhost:50000/symroot
db2.client.db.url=jdbc:db2://localhost:50000/symclien

db2i.db.driver=com.ibm.as400.access.AS400JDBCDriver
db2i.db.user=
Expand All @@ -145,37 +145,37 @@ sqlite.client.db.url=jdbc:sqlite:target/clientdbs/client.sqlite
informix.db.driver=com.informix.jdbc.IfxDriver
informix.db.user=informix
informix.db.password=admin
informix.root.db.url=jdbc:informix-sqli://dbdev1.loc:30277/symmetricroot4k:INFORMIXSERVER=ol_informix1210
informix.server.db.url=jdbc:informix-sqli://dbdev1.loc:30277/symmetricroot4k:INFORMIXSERVER=ol_informix1210
informix.client.db.url=jdbc:informix-sqli://dbdev1.loc:30277/symmetricclient4k:INFORMIXSERVER=ol_informix1210
informix.root.db.url=jdbc:informix-sqli://localhost:30277/symmetricroot4k:INFORMIXSERVER=ol_informix1210
informix.server.db.url=jdbc:informix-sqli://localhost:30277/symmetricroot4k:INFORMIXSERVER=ol_informix1210
informix.client.db.url=jdbc:informix-sqli://localhost:30277/symmetricclient4k:INFORMIXSERVER=ol_informix1210

ase.db.driver=com.sybase.jdbc4.jdbc.SybDriver
ase.db.user=sa
ase.db.password=admin123
ase.root.db.url=jdbc:sybase:Tds:dbdev1.loc:5000/symmetricroot
ase.server.db.url=jdbc:sybase:Tds:dbdev1.loc:5000/symmetricroot
ase.client.db.url=jdbc:sybase:Tds:dbdev1.loc:5000/symmetricclient
ase.root.db.url=jdbc:sybase:Tds:localhost:5000/symmetricroot
ase.server.db.url=jdbc:sybase:Tds:localhost:5000/symmetricroot
ase.client.db.url=jdbc:sybase:Tds:localhost:5000/symmetricclient

ase12.db.driver=com.sybase.jdbc4.jdbc.SybDriver
ase12.db.user=sa
ase12.db.password=
ase12.root.db.url=jdbc:sybase:Tds:winxpdev.loc:5000/symmetricroot
ase12.server.db.url=jdbc:sybase:Tds:winxpdev.loc:5000/symmetricroot
ase12.client.db.url=jdbc:sybase:Tds:winxpdev.loc:5000/symmetricclient
ase12.root.db.url=jdbc:sybase:Tds:localhost:5000/symmetricroot
ase12.server.db.url=jdbc:sybase:Tds:localhost:5000/symmetricroot
ase12.client.db.url=jdbc:sybase:Tds:localhost:5000/symmetricclient

asa9.db.driver=com.sybase.jdbc4.jdbc.SybDriver
asa9.db.user=dba
asa9.db.password=sql
asa9.server.db.url=jdbc:sybase:Tds:winxpdev2.loc:2638/symmetricroot
asa9.root.db.url=jdbc:sybase:Tds:winxpdev2.loc:2638/symmetricroot
asa9.client.db.url=jdbc:sybase:Tds:winxpdev2.loc:49152/symmetricclient
asa9.server.db.url=jdbc:sybase:Tds:localhost:2638/symmetricroot
asa9.root.db.url=jdbc:sybase:Tds:localhost:2638/symmetricroot
asa9.client.db.url=jdbc:sybase:Tds:localhost:49152/symmetricclient

asa.db.driver=com.sybase.jdbc4.jdbc.SybDriver
asa.db.user=dba
asa.db.password=sql
asa.server.db.url=jdbc:sybase:Tds:dbdev2.loc:2638/symmetricroot
asa.root.db.url=jdbc:sybase:Tds:dbdev2.loc:2638/symmetricroot
asa.client.db.url=jdbc:sybase:Tds:dbdev2.loc:49152/symmetricclient
asa.server.db.url=jdbc:sybase:Tds:localhost:2638/symmetricroot
asa.root.db.url=jdbc:sybase:Tds:localhost:2638/symmetricroot
asa.client.db.url=jdbc:sybase:Tds:localhost:49152/symmetricclient

azure.db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
azure.db.user=symmetricds
Expand All @@ -189,11 +189,11 @@ tibero.root.db.user=SymmetricRoot
tibero.root.db.password=admin
tibero.client.db.user=SymmetricClient
tibero.client.db.password=admin
tibero.db.url=jdbc:tibero:thin:@192.168.42.110:8629:tibero6
tibero.db.url=jdbc:tibero:thin:@localhost:8629:tibero

ingres.db.driver=com.ingres.jdbc.IngresDriver
ingres.db.user=ingres
ingres.db.password=ingres
ingres.server.db.url=jdbc:ingres://192.168.56.103:II7/SymmetricRoot
ingres.root.db.url=jdbc:ingres://192.168.56.103:II7/SymmetricRoot
ingres.client.db.url=jdbc:ingres://192.168.56.103:II7/SymmetricClient
ingres.server.db.url=jdbc:ingres://localhost:II7/SymmetricRoot
ingres.root.db.url=jdbc:ingres://localhost:II7/SymmetricRoot
ingres.client.db.url=jdbc:ingres://localhost:II7/SymmetricClient

0 comments on commit f51b68f

Please sign in to comment.