<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to sync two embedded Java databases (embedded into an application) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-sync-two-embedded-Java-databases-embedded-into-an/m-p/2328993#M98224</link>
    <description>You problem is very common in all the distributed scenarios ( with offline/online capabilities ). 
&lt;BR /&gt;Also using tools/libraries, you should still program some logic because you must choose who have authority on the data in case of collision (who wins); and this is very dependent on the meaning on the data itself ( ie. a client is not allowed to create new items but only to fetch them from a central server and master db; but of course is able to edit and create orders based on item data). 
&lt;BR /&gt;I can say that Talend is 100% java and embeddable ( produces pure java code ), provide facilities to filter and move data ( also accoding to keys ) and can also compute CRC function on whole db rows ( to do rapid comparisons ) and also internet file transfer facilites and webservices input/output.</description>
    <pubDate>Sun, 27 Sep 2009 16:50:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-09-27T16:50:39Z</dc:date>
    <item>
      <title>How to sync two embedded Java databases (embedded into an application)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-sync-two-embedded-Java-databases-embedded-into-an/m-p/2328992#M98223</link>
      <description>Seeking: A free or commercial product / api / tool that can be embedded 
&lt;BR /&gt;into a Java app to sync two HSQLDB databases and handle complex rules 
&lt;BR /&gt;--- 
&lt;BR /&gt;Summary: 
&lt;BR /&gt;We have a desktop application that uses the db on the back end to store 
&lt;BR /&gt;info and have some unique syncing problems. 
&lt;BR /&gt;We want to programatically sync the users database when they launch 
&lt;BR /&gt;the app (so the solution must be embedded into the application) 
&lt;BR /&gt;and it must be a 100% Java solution. 
&lt;BR /&gt;The user has the ability to install the app, do some stuff that puts 
&lt;BR /&gt;data into the local db (call this Client A) and then sync to a central 
&lt;BR /&gt;server, which merely puts the db file on the server (puts the db file 
&lt;BR /&gt;into a column on production database) 
&lt;BR /&gt;The user then has the ability to go to another computer, install the 
&lt;BR /&gt;app, and if the user has an account and logs in, it will download the db 
&lt;BR /&gt;file from a server (where it was put by Client A in the step above) 
&lt;BR /&gt;The user may run either client in offline mode where data is changed at 
&lt;BR /&gt;any point, such that local changes do not get sync'd to the server (but 
&lt;BR /&gt;at some point in the future may get sync'd) 
&lt;BR /&gt;--- 
&lt;BR /&gt;What we want to do is handle all cases where Client A (that has been in 
&lt;BR /&gt;offline mode for some time and has made many local changes) gets data 
&lt;BR /&gt;from a recent sync from Client B and handles everything correctly. 
&lt;BR /&gt;At first look this will require a lot of programming to do this, and we 
&lt;BR /&gt;would like to know if there is a tool or product out there that will do 
&lt;BR /&gt;what we need to do. 
&lt;BR /&gt;Is there a tool that can be used to sync between the two databases 
&lt;BR /&gt;(through using a central always on server) when only one app can be 
&lt;BR /&gt;active at any time and handle the offline scenarios? 
&lt;BR /&gt;--- 
&lt;BR /&gt;Simply fetching the database files each time a client launches is not an 
&lt;BR /&gt;option, because of the "offline mode" where Client A may have some data 
&lt;BR /&gt;that was added or changed offline (at a later date than the last sync) 
&lt;BR /&gt;so if we get the db file from the server it will erase those changes. 
&lt;BR /&gt;We need to handle complex cases like 
&lt;BR /&gt;Client A: (online mode) 
&lt;BR /&gt; launch and add some data 
&lt;BR /&gt; sync the db file to the server 
&lt;BR /&gt; close client A 
&lt;BR /&gt;Client B: (online mode) 
&lt;BR /&gt; launch the app and get latest data file from the server 
&lt;BR /&gt; add some data 
&lt;BR /&gt; * rename an item 
&lt;BR /&gt; sync the new data to the server 
&lt;BR /&gt;Client A: (offline mode) 
&lt;BR /&gt; launch the app, can not sync from server because offline 
&lt;BR /&gt; * rename the same item as above (so this is the latest rename) 
&lt;BR /&gt; Now sync from the server 
&lt;BR /&gt; Expected: Do not want to get the item renamed as set from Client B, 
&lt;BR /&gt;but should be the rename from Client A, after the sync. 
&lt;BR /&gt; For this reason we can not simply download the latest db file from 
&lt;BR /&gt;the server and use it. 
&lt;BR /&gt; We have to do a merge of the db files but handle changes according 
&lt;BR /&gt;to a time stamp, and only merge changes that are the most recent changes. 
&lt;BR /&gt; There will be collisions and conflicts that we have to resolve and 
&lt;BR /&gt;this looks like a complex programming problem. 
&lt;BR /&gt;If anyone has any idea on free or commercial products that can be 
&lt;BR /&gt;embedded into a Java app to sync two hsqldb databases and handle complex rules, please 
&lt;BR /&gt;drop me a line. 
&lt;BR /&gt;We have a few ideas, but want to explore all options.</description>
      <pubDate>Sat, 16 Nov 2024 13:45:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-sync-two-embedded-Java-databases-embedded-into-an/m-p/2328992#M98223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to sync two embedded Java databases (embedded into an application)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-sync-two-embedded-Java-databases-embedded-into-an/m-p/2328993#M98224</link>
      <description>You problem is very common in all the distributed scenarios ( with offline/online capabilities ). 
&lt;BR /&gt;Also using tools/libraries, you should still program some logic because you must choose who have authority on the data in case of collision (who wins); and this is very dependent on the meaning on the data itself ( ie. a client is not allowed to create new items but only to fetch them from a central server and master db; but of course is able to edit and create orders based on item data). 
&lt;BR /&gt;I can say that Talend is 100% java and embeddable ( produces pure java code ), provide facilities to filter and move data ( also accoding to keys ) and can also compute CRC function on whole db rows ( to do rapid comparisons ) and also internet file transfer facilites and webservices input/output.</description>
      <pubDate>Sun, 27 Sep 2009 16:50:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-sync-two-embedded-Java-databases-embedded-into-an/m-p/2328993#M98224</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-09-27T16:50:39Z</dc:date>
    </item>
  </channel>
</rss>

