View Issue Details

IDProjectCategoryView StatusLast Update
0001734SymmetricDSBugpublic2014-07-07 09:55
ReporterazarubkinAssigned Tochenson 
Prioritynormal 
Status closedResolutionfixed 
Product Version3.5.22 
Target Version3.6.1Fixed in Version3.6.1 
Summary0001734: Audit table created with wrong schema
DescriptionWhen I create audit table, it is created in 'symmetricds' schema, that is of the user SymmetricDS runs under. The router tries to insert rows into audit table which is placed in 'dbo' schema. The object is not found and it gives up.

Please note the SQL used to create audit table. The schema is not specified, and SQL Server defaults to the schema of running user, that is, 'symmetricds'.

Setting 'target_schema_name' in ROUTER table to 'symmetricds' did not help, it still tries to insert rows into guard.dbo.script_audit table.
Steps To Reproduce1. Create audit router as specified in documentation, including NODE_GROUP_LINK and NODE_GROUP entries.
2. Create trigger for target table ('script' table in my case).
3. Create TRIGGER_ROUTER link between them.
4. Modify a row in 'script' table. The router fails to insert audit data.
Additional Information2014-05-29 17:33:55,109 INFO [main] [MsSqlDatabasePlatform] [main-job-10] Running alter sql:
SET quoted_identifier on;
SET quoted_identifier on;
CREATE TABLE "script_audit"
(
    "audit_id" DECIMAL(19,0) NOT NULL,
    "audit_time" DATETIME,
    "audit_event" CHAR(1),
    "id" int identity,
    "script_name" varchar(50),
    PRIMARY KEY ("audit_id")
);

2014-05-29 17:21:56,031 ERROR [main] [RouterService] [main-job-10] Failed to route and batch data on 'default' channel
org.jumpmind.db.sql.SqlException: Invalid object name 'guard.dbo.script_audit'.
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:288)
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:279)
    at org.jumpmind.db.sql.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:417)
    at org.jumpmind.db.sql.JdbcSqlTemplate.queryForObject(JdbcSqlTemplate.java:136)
    at org.jumpmind.db.sql.AbstractSqlTemplate.queryForLong(AbstractSqlTemplate.java:80)
    at org.jumpmind.symmetric.route.AuditTableDataRouter.routeToNodes(AuditTableDataRouter.java:96)
    at org.jumpmind.symmetric.service.impl.RouterService.routeData(RouterService.java:644)
    at org.jumpmind.symmetric.service.impl.RouterService.selectDataAndRoute(RouterService.java:566)
    at org.jumpmind.symmetric.service.impl.RouterService.routeDataForChannel(RouterService.java:382)
    at org.jumpmind.symmetric.service.impl.RouterService.routeDataForEachChannel(RouterService.java:299)
    at org.jumpmind.symmetric.service.impl.RouterService.routeData(RouterService.java:164)
    at org.jumpmind.symmetric.job.RouterJob.doJob(RouterJob.java:40)
    at org.jumpmind.symmetric.job.AbstractJob.invoke(AbstractJob.java:180)
    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(Unknown Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Activities

chenson

2014-07-07 09:55

administrator   ~0000540

This was resolved in 3.6 with the introduction of schema and catalog to the DDL builder

Issue History

Date Modified Username Field Change
2014-05-29 09:36 azarubkin New Issue
2014-07-07 09:55 chenson Note Added: 0000540
2014-07-07 09:55 chenson Fixed in Version => 3.6.1
2014-07-07 09:55 chenson Target Version => 3.6.1
2014-07-07 09:55 chenson Status new => closed
2014-07-07 09:55 chenson Assigned To => chenson
2014-07-07 09:55 chenson Resolution open => fixed