sqlite-sync / SQLite-sync.com

AMPLI-SYNC is a framework for synchronizing data between a Sqlite database and an MS SQL/MySQL/Oracle/PostgreSQL database. With this framework your application can work completely offline (Airplane Mode), then perform an automated Bidirectional Synchronization when an internet connection becomes available.
https://ampliapps.com/sqlite-sync/
BSD 3-Clause "New" or "Revised" License
328 stars 82 forks source link

some errors about ReinitializeDatabase (C#) #18

Open jqrv opened 4 years ago

jqrv commented 4 years ago

when I ReinitializeDatabase , the framework start to create table . but some times, it doesn't add [RowID] column to the client.

as I know, if a table whithout RowID then can't sync.

I've created 2 tables on the server, test and test2. when I click ReinitializeDatabase button test2 has no [Rowid] column,but test has!

I add the exist table to sync(call AddTable API) always get this error.

here is the ReinitializeDatabase response content:

we can see about the create table test2 code, it really has no [RowID]!

there is a 'rowid' in the test table:

"00014 test" : "CREATE TABLE \"test\" ([id] INTEGER ,[name] TEXT DEFAULT ('NULL') ,[age] INTEGER DEFAULT (NULL) ,[birthday] DATETIME ,[RowId] TEXT DEFAULT ('NULL') ,\"MergeUpdate\" INTEGER NOT NULL DEFAULT (0) );",

but,there is not a 'rowid' in the test2 table.

"00007 test2" : "CREATE TABLE \"test2\" ([id] INTEGER ,[country] TEXT DEFAULT ('NULL') ,[city] TEXT DEFAULT ('NULL') ,[code] INTEGER DEFAULT (NULL) ,\"MergeUpdate\" INTEGER NOT NULL DEFAULT (0) );",

jqrv commented 4 years ago

I found the reason. when you use addtable api to add a table to sync ,or change your master db schema. you should restart tomcat!

sqlite-sync commented 4 years ago

As a matter of fact, only when you change your master db schema you need to restart tomcat (or application). It happens because connection pooling is used, and it needs to be refreshed.

On Wed, Nov 6, 2019 at 3:05 AM jqrv notifications@github.com wrote:

I found the reason. when you use addtable api to add a table to sync ,or change your master db schema. you should restart tomcat!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sqlite-sync/SQLite-sync.com/issues/18?email_source=notifications&email_token=ACNU5N3Y6KYY7QAILXQE7HLQSIQ6ZA5CNFSM4JI4PMV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDE7YUY#issuecomment-550108243, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNU5NYUPDOKTY3B6RDFA7LQSIQ6ZANCNFSM4JI4PMVQ .

-- Best regards Tomek Dziemidowicz E-mail: tomek@dziemidowicz.cloud Take care of the Environment with us! Do not print this message or other documents if it is not necessary.

jqrv commented 4 years ago

you are right.

sqlite-sync commented 4 years ago

Can you share the schema of table test2? Does log contain anything, any errors?