Skip to content

Commit

Permalink
add a triggersSupported flag to platform info and check it in syncTri…
Browse files Browse the repository at this point in the history
…ggers()
  • Loading branch information
chenson42 committed Oct 25, 2011
1 parent 9ab0c7f commit e730b1f
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 146 deletions.
Expand Up @@ -709,25 +709,28 @@ public void syncTriggers() {
syncTriggers(null, false);
}

public void syncTriggers(StringBuilder sqlBuffer, boolean gen_always) {
if (clusterService.lock(ClusterConstants.SYNCTRIGGERS)) {
synchronized (this) {
try {
log.info("TriggersSynchronizing");
// make sure channels are read from the database
configurationService.reloadChannels();
List<Trigger> triggersForCurrentNode = getTriggersForCurrentNode();
inactivateTriggers(triggersForCurrentNode, sqlBuffer);
updateOrCreateDatabaseTriggers(triggersForCurrentNode, sqlBuffer, gen_always);
resetTriggerRouterCacheByNodeGroupId();
} finally {
clusterService.unlock(ClusterConstants.SYNCTRIGGERS);
log.info("TriggersSynchronized");
}
}
} else {
log.info("TriggersSynchronizingFailedLock");
}
public void syncTriggers(StringBuilder sqlBuffer, boolean gen_always) {
if (dbDialect.getPlatform().getPlatformInfo().isTriggersSupported()) {
if (clusterService.lock(ClusterConstants.SYNCTRIGGERS)) {
synchronized (this) {
try {
log.info("TriggersSynchronizing");
// make sure channels are read from the database
configurationService.reloadChannels();
List<Trigger> triggersForCurrentNode = getTriggersForCurrentNode();
inactivateTriggers(triggersForCurrentNode, sqlBuffer);
updateOrCreateDatabaseTriggers(triggersForCurrentNode, sqlBuffer,
gen_always);
resetTriggerRouterCacheByNodeGroupId();
} finally {
clusterService.unlock(ClusterConstants.SYNCTRIGGERS);
log.info("TriggersSynchronized");
}
}
} else {
log.info("TriggersSynchronizingFailedLock");
}
}
}

protected Set<String> getTriggerIdsFrom(List<Trigger> triggersThatShouldBeActive) {
Expand Down

0 comments on commit e730b1f

Please sign in to comment.