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

Error while syncing databases! #5

Open hagabr opened 5 years ago

hagabr commented 5 years ago

Im getting this error message in the mobile App "Error while syncing databases!"

In my case I have 3 main table to sync.

Product-->always syncing from DB to App Customer-->always syncing from DB to App Orders<--just App creates new records and send to DB

Sometimes for instance Product's price changes. Some internal process update the table Product.

Next time the App sync get this error message: "Error while syncing databases!"

Sync is not finished. Sqlite-sync sometimes crashes. If we restart maybe the next sync will work.

tdziemidowicz commented 5 years ago

This is happening, because underlying error occurs. When it happens connection is not closed properly (we fixed that error in version 3.2.x). I've sent you newer version in private message. Let me know if it helped.

hagabr commented 5 years ago

I have tested ther version 3.2.3 and it works fine. I sent and received a lot of records. So I wait about 2 hours before release to production and when Im back the app was stoped. Catalina.log records this logs about memory leak.

I remember this problem in version 3.1.9. Then you fixed it in 3.1.13. First some WARNING then SEVERE

=================================

10-May-2019 00:55:33.397 WARNING [http-nio-8080-exec-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ambienteteste] appears to have started a thread named [C3P0PooledConnectionPoolManager[identityToken->z8kfsxa217zmgxih13nxs|431d9db7]-HelperThread-#2] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Object.wait(Native Method) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:683)

10-May-2019 00:55:33.400 SEVERE [http-nio-8080-exec-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ambienteteste] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@164d1013]) and a value of type [org.glassfish.jersey.internal.Errors] (value [org.glassfish.jersey.internal.Errors@254ca137]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

10-May-2019 00:55:33.406 SEVERE [http-nio-8080-exec-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ambienteteste] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@32d0f246]) and a value of type [org.glassfish.jersey.process.internal.RequestScope.Instance] (value [Instance{id=5218cdd9-99c1-4185-8339-b98290c0eefd, referenceCounter=2, store size=5}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

tdziemidowicz commented 5 years ago

what database do you use as master?

hagabr commented 5 years ago

SQL Server 2008