View Issue Details

IDProjectCategoryView StatusLast Update
0005903SymmetricDSBugpublic2023-07-05 20:00
Reporterdanpurvis Assigned Topmarzullo  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.14.7 
Target Version3.14.8Fixed in Version3.14.8 
Summary0005903: Failing to create trigger on table
DescriptionI have a setup running on MS SQLServer with around 50 tables, that sync just fine from a central DB to a few nodes.

One table is failing to create triggers on both the central db or any of the nodes.

CREATE TABLE [dbo].[WeighingEntriesPeople](
    [WeighingEntryId] [uniqueidentifier] NOT NULL,
    [PersonId] [uniqueidentifier] NOT NULL,
    [TimeStart] [datetimeoffset](7) NOT NULL,
    [TimeEnd] [datetimeoffset](7) NULL,
 CONSTRAINT [PK_WeighingEntriesPeople] PRIMARY KEY CLUSTERED
(
    [WeighingEntryId] ASC,
    [PersonId] ASC,
    [TimeStart] ASC
)

2023-06-16 00:00:01,440 INFO [node1] [MsSql2016SymmetricDialect] [node1-sync-triggers-1] Creating SYM_ON_I_FOR_WGHNGNTRSPPL_FRM trigger for AppDB.dbo.WeighingEntriesPeople
2023-06-16 00:00:01,448 INFO [node1] [TriggerRouterService] [node1-sync-triggers-1] Cleaning up trigger hist row of 165 after failing to create the associated trigger
2023-06-16 00:00:01,450 ERROR [node1] [TriggerRouterService] [node1-sync-triggers-1] Failed to create triggers for dbo.WeighingEntriesPeople StackTraceKey.init [NotImplementedException:3066939659] org.apache.commons.lang3.NotImplementedException: Column [name=TimeStart; jdbcType=datetimeoffset; mappedType=TIMESTAMPTZ] is of type TIMESTAMPTZ
    at org.jumpmind.symmetric.db.AbstractTriggerTemplate.buildKeyVariablesDeclare(AbstractTriggerTemplate.java:1020)
    at org.jumpmind.symmetric.db.mssql.MsSqlTriggerTemplate.replaceTemplateVariables(MsSqlTriggerTemplate.java:504)
    at org.jumpmind.symmetric.db.mssql.MsSql2008TriggerTemplate.replaceTemplateVariables(MsSql2008TriggerTemplate.java:41)
    at org.jumpmind.symmetric.db.AbstractTriggerTemplate.createTriggerDDL(AbstractTriggerTemplate.java:353)
    at org.jumpmind.symmetric.db.AbstractSymmetricDialect.createTrigger(AbstractSymmetricDialect.java:385)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.rebuildTriggerIfNecessary(TriggerRouterService.java:2271)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.updateOrCreateDatabaseTriggers(TriggerRouterService.java:2119)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.updateOrCreateDatabaseTrigger(TriggerRouterService.java:1987)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService$2.run(TriggerRouterService.java:1848)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Tagsdata type, dialect: sql-server, sync-trigger

Activities

pmarzullo

2023-07-05 18:02

developer   ~0002353

Move calls to MsSql2000TriggerTemplate:
@Override
    protected String replaceTemplateVariables(DataEventType dml, Trigger trigger,
            TriggerHistory history, Channel channel, String tablePrefix, Table originalTable, Table table,
            String defaultCatalog, String defaultSchema, String ddl)
    {
        super.replaceTemplateVariables(...);
        ddl = FormatUtils.replace("declareOldKeyVariables",
                buildKeyVariablesDeclare(columns, "old"), ddl);
        ddl = FormatUtils.replace("declareNewKeyVariables",
                buildKeyVariablesDeclare(columns, "new"), ddl);

Remove from MsSqlTriggerTemplate the two calls:
        ddl = FormatUtils.replace("declareOldKeyVariables",
                buildKeyVariablesDeclare(columns, "old"), ddl);
        ddl = FormatUtils.replace("declareNewKeyVariables",
                buildKeyVariablesDeclare(columns, "new"), ddl);

Related Changesets

SymmetricDS: 3.14 552291bf

2023-07-05 19:23:33

pmarzullo

Details Diff
0005903: Failing to create trigger on table Affected Issues
0005903
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/mssql/MsSqlTriggerTemplate.java Diff File
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/mssql2000/MsSql2000TriggerTemplate.java Diff File

Issue History

Date Modified Username Field Change
2023-06-29 03:39 danpurvis New Issue
2023-07-05 18:02 pmarzullo Note Added: 0002353
2023-07-05 18:03 pmarzullo Assigned To => pmarzullo
2023-07-05 18:03 pmarzullo Status new => assigned
2023-07-05 19:23 pmarzullo Tag Attached: dialect: sql-server
2023-07-05 19:23 pmarzullo Tag Attached: sync-trigger
2023-07-05 19:23 pmarzullo Tag Attached: data type
2023-07-05 19:24 pmarzullo Status assigned => resolved
2023-07-05 19:24 pmarzullo Resolution open => fixed
2023-07-05 19:24 pmarzullo Fixed in Version => 3.14.8
2023-07-05 20:00 pmarzullo Changeset attached => SymmetricDS 3.14 552291bf
2023-07-19 12:58 admin Status resolved => closed