Home > Archive > SQL Anywhere ultralite > October 2005 > Background syncronization









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Background syncronization
Timothy Dean

2005-10-27, 7:41 am

If I want to synchronize in the background while the user is still in the
app doing read operations on the database, do I need to create a separate
thread to do the sync? If I execute Synchronize in the same thread, will
the program wait until the synchronization is done before moving on? Or
will it move on immediately (separate thread being created automatically?)
Thanks.

Timothy Dean


Greg Fenton

2005-10-27, 7:41 am

Timothy Dean wrote:
> If I execute Synchronize in the same thread, will
> the program wait until the synchronization is done before moving on? Or
> will it move on immediately (separate thread being created automatically?)


Please always post the versoin and build number of UltraLite that you
are using as well as the API that you are using.

I do not believe that any of our APIs spawn their own thread during
synchronization (though please someone correct me if I'm wrong).

You'll need to create a second thread to still be reading from the UL
databse while synchronization is going on as the first thread will be
dedicated to running the synchronize function.

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
handheldmaster

2005-10-27, 7:41 am

>
> You'll need to create a second thread to still be reading from the UL
> databse while synchronization is going on as the first thread will be
> dedicated to running the synchronize function.


You can try this alternate .... though not tested myself.

Create a separate APPLICATION (EXE) itself that does the read operation ..
this way you automatically create a second thread (or instance in this
case). Also you will need to have different connection names.










Greg Fenton

2005-10-27, 7:41 am

handheldmaster wrote:
>
> Create a separate APPLICATION (EXE) itself that does the read operation ..
> this way you automatically create a second thread (or instance in this
> case). Also you will need to have different connection names.


I believe this approach will only work if you are using the UL engine
(uleng9.exe) as only one process can have the file open at a time.

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Tom Slee

2005-10-27, 7:41 am

I have recently submitted a demo of resumable download synchronization
to CodeXchange. It is not available yet, but should be in a day or two.
It uses the ADO.NET interface and shows using a separate thread to
maintain the database while the synchronization happens. It is probably
better to use a separate thread for synchronization than to do new
operations on a separate thread.

(http://ianywhere.codexchange.sybase...=283&folderID=0).

Concurrency issues to do with background sync are discussed at
http://tinyurl.com/9ssvy.

Tom Slee

Greg Fenton wrote:
> handheldmaster wrote:
>
>
>
> I believe this approach will only work if you are using the UL engine
> (uleng9.exe) as only one process can have the file open at a time.
>
> greg.fenton

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com