View Issue Details

IDProjectCategoryView StatusLast Update
0001533SymmetricDSBugpublic2014-02-02 20:53
ReporterazarubkinAssigned Tochenson 
Priorityhigh 
Status closedResolutionfixed 
Product Version3.5.13 
Target Version3.5.14Fixed in Version3.5.14 
Summary0001533: Unable to create trigger if primary key column excluded
DescriptionHello all,

I configured synchronization of table from store to corp. If I exclude PK column from synchronization, I get the following error:

2014-01-16 11:21:43,484 ERROR [post] [TriggerRouterService] [post-job-14] Failed to create triggers for events
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:872)
    at java.lang.StringBuilder.substring(StringBuilder.java:72)
    at org.jumpmind.symmetric.db.AbstractTriggerTemplate.buildColumnNameString(AbstractTriggerTemplate.java:559)
    at org.jumpmind.symmetric.db.AbstractTriggerTemplate.replaceTemplateVariables(AbstractTriggerTemplate.java:383)
    at org.jumpmind.symmetric.db.AbstractTriggerTemplate.createTriggerDDL(AbstractTriggerTemplate.java:261)
    at org.jumpmind.symmetric.db.AbstractSymmetricDialect.createTrigger(AbstractSymmetricDialect.java:301)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.rebuildTriggerIfNecessary(TriggerRouterService.java:1507)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.updateOrCreateDatabaseTriggers(TriggerRouterService.java:1378)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.updateOrCreateDatabaseTrigger(TriggerRouterService.java:1262)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.updateOrCreateDatabaseTriggers(TriggerRouterService.java:1252)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.syncTriggers(TriggerRouterService.java:1031)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.syncTriggers(TriggerRouterService.java:982)
    at org.jumpmind.symmetric.service.impl.TriggerRouterService.syncTriggers(TriggerRouterService.java:978)
    at org.jumpmind.symmetric.load.ConfigurationChangedFilter.syncEnded(ConfigurationChangedFilter.java:271)
    at org.jumpmind.symmetric.service.impl.DataLoaderService.loadDataFromTransport(DataLoaderService.java:415)
    at org.jumpmind.symmetric.service.impl.DataLoaderService.loadDataFromPull(DataLoaderService.java:265)
    at org.jumpmind.symmetric.service.impl.PullService.execute(PullService.java:129)
    at org.jumpmind.symmetric.service.impl.NodeCommunicationService$2.run(NodeCommunicationService.java:307)
    at org.jumpmind.symmetric.service.impl.NodeCommunicationService.execute(NodeCommunicationService.java:320)
    at org.jumpmind.symmetric.service.impl.PullService.pullData(PullService.java:99)
    at org.jumpmind.symmetric.job.PullJob.doJob(PullJob.java:39)
    at org.jumpmind.symmetric.job.AbstractJob.invoke(AbstractJob.java:177)
    at org.jumpmind.symmetric.job.AbstractJob.run(AbstractJob.java:224)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
TagsNo tags attached.

Activities

azarubkin

2014-01-16 05:19

reporter   ~0000421

Don't know if it is a workaround or official solution, but I solved my problem by mentioning an alternate unique key in sync_columns.
Probably it's still a bug because SymmetricDS should give sane warning at least, not stack trace. And I see no reason why one-way synchronization without primary key should be forbidden if you know what you're doing (there shouldn't be any synchronized tables with FKs on this table since PK gets new value).

chenson

2014-01-16 17:35

administrator   ~0000422

This applies to all platforms. You will still get the error if the only columns left are lob columns.

Related Changesets

SymmetricDS: master a3de344b

2014-01-16 17:36:34

chenson

Details Diff
0001533: Unable to create trigger if primary key column excluded
0001533
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/TriggerRouterService.java Diff File

Issue History

Date Modified Username Field Change
2014-01-16 02:31 azarubkin New Issue
2014-01-16 05:19 azarubkin Note Added: 0000421
2014-01-16 17:35 chenson Fixed in Version => 3.5.14
2014-01-16 17:35 chenson Target Version => 3.5.14
2014-01-16 17:35 chenson Note Added: 0000422
2014-01-16 17:36 chenson Summary Unable to create trigger in SQLite if primary key column excluded => Unable to create trigger if primary key column excluded
2014-01-16 17:37 chenson Status new => resolved
2014-01-16 17:37 chenson Resolution open => fixed
2014-01-16 17:37 chenson Assigned To => chenson
2014-01-17 08:18 chenson Status resolved => closed
2014-02-02 20:53 Changeset attached => SymmetricDS trunk r7870
2015-07-30 21:49 chenson Changeset attached => SymmetricDS master a3de344b