View Issue Details

IDProjectCategoryView StatusLast Update
0003521SymmetricDSBugpublic2019-04-26 19:52
Reporterddlg_2 Assigned Tojosh-a-hicks  
Status closedResolutionfixed 
Product Version3.9.6 
Target Version3.10.0Fixed in Version3.10.0 
Summary0003521: Create Table First is creating table with all columns as primary key instead of none
DescriptionIn the case of source_node_database_tables do not have any primary keys and some fields of the source_node_database_tables are empty, target_node_database_tables are created successfully when initial load firstly, but Symmetric can not insert automatically values into target_node_database_tables.

part of target_node symmetric.log:

2018-04-18 15:37:41,006 INFO [server-010] [DefaultDatabaseWriter] [server-010-dataloader-2] Failed to process insert event in batch 001-12 on channel 'reload'.
Failed sql was: insert into `test`.`jc_ckdd` (`ckdd_id`, `ckdd_bh`, `ckdd_dd`, `ckdd_cjsj`, `ckdd_by1`, `id`) values (?,?,?,?,?,?)
Failed sql parameters: ['1', '0021001AD6C3', '??13#???', {ts '2018-01-28 16:09:43.000'}, '7896', null]
Failed sql state and code: 23000 (1048)
Failed row data was: "1","0021001AD6C3","??13#???","2018-01-28 16:09:43","7896",
 StackTraceKey.init [SqlException:2774797739]
org.jumpmind.db.sql.SqlException: Column 'id' cannot be null
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(
    at org.jumpmind.db.sql.AbstractSqlTemplate.translate(
    at org.jumpmind.db.sql.JdbcSqlTransaction.addRow(
    at org.jumpmind.symmetric.model.ProcessInfoDataWriter.write(
    at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$
    at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$

part of source_node symmetric.log:

2018-04-18 15:37:36,668 INFO [client1-001] [PushService] [client1-001-push-default-10] Push data sent to server:010:010
2018-04-18 15:37:40,139 INFO [client1-001] [PushService] [client1-001-push-default-10] Pushed data to node server:010:010. 6 data and 6 batches were processed. (sym_node_security, sym_node, jc_lfyhis, jc_ckdd, jc_lfy, jc_ckdw)
2018-04-18 15:37:40,139 INFO [client1-001] [PushService] [client1-001-push-default-10] Pushing to server:010:010 again because the last push contained reload batches
2018-04-18 15:37:40,315 INFO [client1-001] [PushService] [client1-001-push-default-10] Push data sent to server:010:010
2018-04-18 15:37:41,347 ERROR [client1-001] [AcknowledgeService] [client1-001-push-default-10] The outgoing batch 010-12 failed: [23000,1048] Column 'id' cannot be null

I have uploaded the symmetric.log
Steps To Reproducesource node:
1.Oracle database type
2.Tables of needing to synchronzie do not have any primary keys and some fields of the tables are empty in the oracle database

target node:
1.MariaDB/MySQL database type the MariaDB/MySQL database, it has not the source_node_database_tables of needing to synchronzie
Tagsinitial/partial load


has duplicate 0003529 closed Symmetric needs to insert successfully null value into target_node_database_tables when initial load firstly 
related to 0002426 closedjosh-a-hicks Sym server create Primary Keys for all fields in table without PK 
related to 0000755 closedelong When missing primary key, update where clause needs to use "is null" for null values 



2018-04-18 09:20


symmetricSource.log (607,330 bytes)
symmetricTarget.log (358,785 bytes)


2018-04-18 15:51

developer   ~0001164

You tried to sync a null value to the "id" column, which is defined as not nullable, so the database rejects the row. What did you expect to happen?


2018-04-19 01:18

reporter   ~0001165

Thanks for the quick response!

In the case of source tables(need to sync) do not have any primary keys and some columns are null, I want to sync a null value to the "id" column or other column,which is defined as nullable, can you reach it?

In the case, I know that symmetric will create primary key for each filed of target tables when the symmetric create target table .



2018-10-03 17:20

developer   ~0001252

Will change the default behavior in 3.10.

If a table does not have a PK SymmetricDS will try to create a target table with all columns used in the PK. This allows
loads to run multiple times without duplicate data. The first time would insert, additional runs would fall back to updates and
since the target has a PK now it will not duplicate. In your case though you have tables with too large of columns to use all cols
in PK. You can set the following parameter to create the target without PKs as the source. However you will need to use the delete first
on the table reload request to ensure every time data is loaded into the target it is deleted or truncated so that duplicates to not occur.

Make this the default going forward:

Related Changesets

SymmetricDS: 3.10 42f9e4e9

2018-10-15 16:32:41


Details Diff
0003521: Create Table First is creating table with all columns as
primary key instead of none
Affected Issues
mod - symmetric-core/src/main/resources/ Diff File

Issue History

Date Modified Username Field Change
2018-04-18 09:17 ddlg_2 New Issue
2018-04-18 09:17 ddlg_2 Tag Attached: table_reload_request
2018-04-18 09:20 ddlg_2 File Added: symmetricSource.log
2018-04-18 09:20 ddlg_2 File Added: symmetricTarget.log
2018-04-18 15:51 elong Note Added: 0001164
2018-04-19 01:18 ddlg_2 Note Added: 0001165
2018-10-03 16:56 hanes Status new => feedback
2018-10-03 17:20 hanes Product Version 3.9.6 => 3.10.0
2018-10-03 17:20 hanes Summary Symmetric can not insert automatically values into target_node_database_tables when initial load firstly => Create Table First is creating table with all columns as primary key instead of none
2018-10-03 17:20 hanes Note Added: 0001252
2018-10-03 17:20 hanes Status feedback => confirmed
2018-10-03 17:47 hanes Product Version 3.10.0 => 3.9.6
2018-10-03 17:47 hanes Target Version => 3.10.0
2018-10-03 17:47 hanes Relationship added has duplicate 0003529
2018-10-15 20:30 josh-a-hicks Assigned To => josh-a-hicks
2018-10-15 20:30 josh-a-hicks Status confirmed => assigned
2018-10-15 20:33 josh-a-hicks Status assigned => resolved
2018-10-15 20:33 josh-a-hicks Resolution open => fixed
2018-10-15 20:33 josh-a-hicks Fixed in Version => 3.10.0
2018-11-28 16:00 josh-a-hicks Changeset attached => SymmetricDS 3.10 42f9e4e9
2019-03-14 12:48 admin Status resolved => closed
2019-04-12 16:33 admin Tag Renamed table_reload_request => initial/partial load
2019-04-23 20:13 elong Relationship added related to 0002426
2019-04-26 19:52 elong Relationship added related to 0000755