I finally managed to synchronize my SqlCompact DB on my Windows CE 6.0 device with SQL server as in http://msdn.microsoft.com/en-us/library/dd938879.aspx.
My application is receiving data from internal microcontroller over RS232 every second. After that i do some calculations and insert data into DB on my device. The problem is when I call syncagent.synchronize (function is on a separate thread with lowest priority selected) another thread that reads COM port doesn't read any data from serial port. It is checking the serial buffer buffer but there is nothing in there.
Could it be that whole synchronize function calls something outside my application which is blocking the system functions which are controlling serial port?Could I somehow set priority to system functions that syncagent calls, or the system function that is controlling serial com buffer?
And I am not even synchronizing a lot (aprox. 60 rows 300 bytes each)
Hope someone has a solution to this.
Am almost certain there's nothing closely related to serial ports in the database sync of Sync Fx. How are you testing to determine that there's no data coming in? Are you checking if data from the port got added while you're doing a sync?
- Edited by JuneTMVP, Moderator Tuesday, August 27, 2013 1:57 PM
yes I have two threads in my application in first one I check serialport.bytestoread every 50ms (thread.sleep(50)), and in second I call syncagent.synchronize. I measure time how long sync takes and its just above 4 seconds. In the mean time 4 packets should arrive to serialport (completely independent micro controller is sending this data every second), but every time there is a sync in progress the serialport.bytestoread is empty all the time. I know that the thread that reads serialport is executed because I put a counter in the thread which I reset when I start the sync and stop the counter when the sync is finished and it is around 80 (80*50ms = 4s).
I have no idea what else could it be. because if the sync is not in progress serialport is filled with data. The problem doesn't occur every time the sync is in progress but it happens. And the counter from thread reading it is always around 80 so the port is being checked.
It's been quite a while since I posted this. Is there really no idea what could be the problem.
In the mean time I created new project which does nothing else except reads serial port (incase some other process in my application would be creating problems), inserts data into table, and tries to sync it. But same problem occurs. While syncing, sometimes happens and there is no data in buffer.
I am stuck here. Any help is very appreciated.
I created separate console application, and the error still occurs. I am not sure if I can solve this pro grammatically I guess Windows ce 6.0 are not made to handle this kind of load. My next try will be to use stronger computer board, and trying out Win EC 7.
If any other suggestion come to mind please do share.