View Issue Details

IDProjectCategoryView StatusLast Update
0004567SymmetricDSBugpublic2022-08-30 13:04
Reporterkraynopp Assigned Toemiller  
Status closedResolutionfixed 
Product Version3.12.3 
Target Version3.14.1Fixed in Version3.14.1 
Summary0004567: sync.table.prefix parameter ignores for sequence in PostgreSQL
DescriptionSymmetricDS uses sym_data_data_id_seq name for sequence and ignores sync.table.prefix parameter for PostgreSQL.
Steps To Reproduce1. I have installed old 3.9.2 SymmetricDS with sync.table.prefix=tst. SymmetricDS has created sequence named tst_data_data_id_seq.
2. I have tried to upgrade to the last 3.12.3 version. In my log file I can see exception - sequence sym_data_data_id_seq does not exists.
Additional Information1. Workaround - sequence can be manually renamed before upgrade. But I suppose sync.table.prefix parameter should work for all SymmetricDS objects including sequence.
2. For Oracle database and sync.table.prefix=tst parameter SymmetricDS creates sequence SEQ_TST_DATA_DATA_ID. And it works well after upgrade, no need to rename sequence.



2020-09-23 17:32

developer   ~0001780

Pretty sure it's always named the sequence with seq (since 2012) and it doesn't use the sync.table.prefix. But it probably should be using the prefix, so we can use the issue to fix the prefix on sequences.


2020-09-24 06:19

reporter   ~0001785

Some additional information. I have made fresh install SymmetricDS with sync.table.prefix=tst. During installation sequence tst_data_data_id_seq has been created, but this installation is not workable. I can see following in log file:

2020-09-24 09:09:09,734 ERROR [pgsql-000] [RouterJob] [pgsql-000-job-1] Exception while executing job 'Routing' StackTraceKey.init [SqlException:3262606664] org.jumpmind.db.sql.SqlException: ERROR: relation "sym_data_data_id_seq" does not exist
  Position: 24
        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.db.postgresql.PostgreSqlSymmetricDialect.getCurrentSequenceValue(
        at org.jumpmind.symmetric.service.impl.DataService.findMaxDataId(
        at org.jumpmind.symmetric.service.impl.DataService.fixLastDataGap(
        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$
        at java.util.concurrent.FutureTask.runAndReset(
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
        at java.util.concurrent.ScheduledThreadPoolExecutor$
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$
Caused by: org.postgresql.util.PSQLException: ERROR: relation "sym_data_data_id_seq" does not exist
  Position: 24
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(
        at org.postgresql.core.v3.QueryExecutorImpl.execute(
        at org.postgresql.jdbc.PgStatement.executeInternal(
        at org.postgresql.jdbc.PgStatement.execute(
        at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(
        at org.postgresql.jdbc.PgPreparedStatement.executeQuery(
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(
        at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(
        at org.jumpmind.db.sql.JdbcSqlTemplate$1.execute(
        at org.jumpmind.db.sql.JdbcSqlTemplate.execute(
        ... 17 more

So, I suppose it is not upgrade issue.

Related Changesets

SymmetricDS: 3.14 96ce0b59

2022-08-04 19:30:13


Details Diff
0004567: Fixed SqlException when using sync.table.prefix Affected Issues
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/db/ Diff File

Issue History

Date Modified Username Field Change
2020-09-23 13:03 kraynopp New Issue
2020-09-23 17:32 elong Status new => confirmed
2020-09-23 17:32 elong Note Added: 0001780
2020-09-24 06:19 kraynopp Note Added: 0001785
2022-08-02 20:08 elong Tag Attached: configuration
2022-08-04 19:30 emiller Assigned To => emiller
2022-08-04 19:30 emiller Status confirmed => resolved
2022-08-04 19:30 emiller Resolution open => fixed
2022-08-04 19:30 emiller Fixed in Version => 3.14.1
2022-08-04 20:00 Changeset attached => SymmetricDS 3.14 96ce0b59
2022-08-30 13:04 admin Status resolved => closed