View Issue Details

IDProjectCategoryView StatusLast Update
0001734SymmetricDSBugpublic2014-07-07 09:55
ReporterazarubkinAssigned Tochenson 
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(
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(
    at org.jumpmind.db.sql.JdbcSqlTemplate.execute(
    at org.jumpmind.db.sql.JdbcSqlTemplate.queryForObject(
    at org.jumpmind.db.sql.AbstractSqlTemplate.queryForLong(
    at org.jumpmind.symmetric.route.AuditTableDataRouter.routeToNodes(
    at org.jumpmind.symmetric.service.impl.RouterService.routeData(
    at org.jumpmind.symmetric.service.impl.RouterService.selectDataAndRoute(
    at org.jumpmind.symmetric.service.impl.RouterService.routeDataForChannel(
    at org.jumpmind.symmetric.service.impl.RouterService.routeDataForEachChannel(
    at org.jumpmind.symmetric.service.impl.RouterService.routeData(
    at org.jumpmind.symmetric.job.RouterJob.doJob(
    at org.jumpmind.symmetric.job.AbstractJob.invoke(
    at java.util.concurrent.Executors$ Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$ Source)
    at Source)
TagsNo tags attached.



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