PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → [WDM21] Proper Way Synchronize HFSQL Data between Local and Client/Server
[WDM21] Proper Way Synchronize HFSQL Data between Local and Client/Server
Iniciado por Sebastian Arnold, jan., 24 2018 10:51 AM - 4 respostas
Membro registado
102 mensagems
Popularité : +2 (2 votes)
Publicado em janeiro, 24 2018 - 10:51 AM
Hi guys,

I just wonder what is the proper way to do something like this:

I've got a Windows CE barcode scanner that saves some data to a local HFSQL table (lets call it SERNUM).

The user of this scanner should be able to transfer this data to a HFSQL client/server database.

So, here is my idea: I open a connection to the CS database and open the table with the same name SERNUM.

Then I loop through each record of my local SERNUM and transfer the data to the server SERNUM (if it doesn't already exist on the server).

So far I couldn't even find out if I can have two connected connections at the same time. Also, I can't find if HCopyFile() is able to merge data into the target file or if it is going to replace the data.

Well, I know there is replication build in but I don't want to go that far for just one table.

Are there other ideas? Anybody have experiance with this?

Thanks in advance
Sebastian

--
http://arnoldconsult.de
WinDev 21 with Oracle, WinDevMobile Android Apps and Motorola Windows CE Mobile Barcode Scanners, Python 3 with Oracle and MySQL
Mensagem modificada, janeiro, 24 2018 - 10:52 AM
Publicado em janeiro, 24 2018 - 1:24 PM
Hi Sebastian,

you can do it with a double connection, a flag in your file to know if
synchronise or not, and record by record work -IF- your mobile is going
to work in a place where you have a GOOD data connection all the time...

Otherwise, I suggest you use a webservice, where you have more control
over the connection/deconection problem...

You can use aither a REST or SOAP webservice (I prefer REST, as it is
simply a webdev page), but both will work...

as for this:

Well, I know there is replication build in but I don't want to go that
far for just one table.


What you want to do -IS- a replication... It's a single file, single
direction replication, but it is a replication... You just don't want to
call it by it's name :-)


If you are interested, my WXreplication, open source, is available on my
web site with a REST type webservice for the communication part

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com
Membro registado
102 mensagems
Popularité : +2 (2 votes)
Publicado em janeiro, 26 2018 - 11:10 AM
Merci beaucoup Fabrice,

you are right. This is replication. To be honest, I'm a little afraid (or lazy?) to install a replication server.

What do you mean by 'double connection'? I just wonder because there is hChangeConnection(). But I don't want to change but instead I wan't an additional connection.

TIA
Sebastian

--
http://arnoldconsult.de
WinDev 21 with Oracle, WinDevMobile Android Apps and Motorola Windows CE Mobile Barcode Scanners, Python 3 with Oracle and MySQL
Publicado em janeiro, 26 2018 - 2:01 PM
Hi Arnold,

you are right. This is replication. To be honest, I'm a little afraid
(or lazy?) to install a replication server.


Instead, you are ready to code your own solution, and fight all the way
to make it simpler... yep... heard that one before :-)

What do you mean by 'double connection'? I just wonder because there is
hChangeConnection(). But I don't want to change but instead I wan't an
additional connection.


There is also hopenconnection, and then you select only THE distant file
for the hchangeconnection...

Your main problem will the the management of
deconnexions/reconnexions... It's such a pain in the butt and a
recurrent problem that there is an article in lst109 about exactly that...

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM
(open source)

More information on http://www.fabriceharari.com

TIA
Sebastian

--
http://arnoldconsult.de WinDev 21 with Oracle, WinDevMobile Android Apps
and Motorola Windows CE Mobile Barcode Scanners, Python 3 with Oracle
and MySQL
Publicado em novembro, 17 2020 - 3:42 PM
Is there a proper solution for the management of disconnecting/reconnecting?
Could somebody might share it with me? :)

And yes, I saw the last answer in 2018...;)