Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Insert statment is not passed to a second client #19

Closed
thefonzi opened this issue Nov 14, 2017 · 15 comments
Closed

[Bug] Insert statment is not passed to a second client #19

thefonzi opened this issue Nov 14, 2017 · 15 comments
Assignees
Labels

Comments

@thefonzi
Copy link

Hi Sébastien,
i have discovered a bug and will try to describe the steps to reproduce.

a) Master database on MSSQL
b) sync to SQLite database Slave1
c) sync to SQLite database Slave2
d) Now insert a new record in one of the slave databases and sync. The record is uploaded to master.
e) Sync on second slave: no record is downloaded to slave2
f) update the record on slave1 and sync: update is synched to master
g) sync on slave2, record is now downloaded

If this is not enough information to reproduce, please let me know and I will setup a small reduced sample.

Reinhold

@Mimetis
Copy link
Owner

Mimetis commented Nov 14, 2017

Will check that !

@Mimetis Mimetis added the bug label Nov 14, 2017
@Mimetis Mimetis self-assigned this Nov 14, 2017
Mimetis added a commit that referenced this issue Nov 15, 2017
…cated on others client (after 1st sync on server)

Adding a new binaryconverter : BinaryFormatter.
Making all classes [Serializable] when necessary (FU ....)
@Mimetis
Copy link
Owner

Mimetis commented Nov 15, 2017

Hello Reinhold;

I made a correction on the Core assembly.
I've added new tests to check this behavior.
Can you please test with the last version ?

@thefonzi
Copy link
Author

Hello Sébastien,
I have now tested with a MasterDB and 3 Slaves and this works now!

But in testing I discovered another strange behavior. Please note: i have not changed the server/client, means there is no expizit conflict management.

Steps:
a) I change a field value in slave1 and sync. Update is uploaded to master
b) I sync on slave2 and upload is downloaded.
c) i change the same field in slave3 and sync. Now I get the message "bad request" and the value is not synched. I have attached a screenshot.

screenshot 3

@Mimetis
Copy link
Owner

Mimetis commented Nov 15, 2017

Strange behavior... and hard to test..
Can you provide more informations on your setup ?

Mimetis added a commit that referenced this issue Nov 15, 2017
@thefonzi
Copy link
Author

I'm trying to setup a testcase, with and without webserver.

@thefonzi
Copy link
Author

testCase.zip
Hi Sébastien,
I have found the exact problem of sync with varbinary(max) fields.
Here are the steps I do:
Sync works via webService!
a) insert a file in master database (MSSQL)
b) sync and record is copied to slave database (SQLite)
c) file is correct and can be opened
d) now I insert a file in slave database and sync. File is uploaded to master database
e) here the file is corrupted.
I have attached a video of the steps and the syncClient, which does the sync.
If you need the whole client + database to reproduce, please let me know.

SyncTest.zip

@Mimetis
Copy link
Owner

Mimetis commented Nov 16, 2017

OK, i will check that

@Mimetis
Copy link
Owner

Mimetis commented Nov 17, 2017

Can you test with the last version ?
The setup to be able to reproduce your bug is quite difficult :) I have to recreate a viewer application, which works with both SQL Server and SQLite
It will take some times...
Will try to create a sample next week (if you still have the issue)

by the way, be careful of the breakings changes from 0.1.5 (see #21)

@thefonzi
Copy link
Author

I will test and let you know.
BTW: I can provide a client, that works with both databases just by switching the connection string.
Let me know, if you want to get that viewer.

@thefonzi
Copy link
Author

Hello Sébastien,
here is a client you can use for testing.
There is a key in config "UpdateDatabase", which forces to create/update the database. Comment this key out on slaves.
And select the right connectionstring for desired database.
I have inserted 3 classes: C4Contact with just a few text fields, C4File with varbinary(max) and C4Photo with image.
Let me know, if you need any additional infos.

Reinhold

DotminXAF.7z001.zip
DotminXAF.7z002.zip
DotminXAF.7z003.zip

@thefonzi
Copy link
Author

adding MySQL library and using this connection string, works with mysql/mariadb too:

@thefonzi
Copy link
Author

add name="ConnectionString" connectionString="XpoProvider=MySql;Server=localhost;User ID=root;Password=mypass;Persist Security Info=true;Charset=utf8;Database=DotminXAF"/

@thefonzi
Copy link
Author

actually i need some time to proceed testing, as my client works with char(36) in GUIDs.
I'm not sure, if that is simple to change.
I'll check and be back soon :-)

Mimetis added a commit that referenced this issue Nov 22, 2017
@Mimetis
Copy link
Owner

Mimetis commented Nov 22, 2017

Hey Reinhold;

Eventually, I've found the bug about the image problem.
Actually, the SQL Provider was trunking varbinary to 8000.
It's corrected in the last push.
Can you give it a try and let me know if it's working ?

I close the issue. Feel free to re-open it if you have another problem with binary files sync.

Sebastien

@Mimetis Mimetis closed this as completed Nov 22, 2017
@thefonzi
Copy link
Author

I will need to write a custom connection provider to access the Sqlite.db with guid.blobs, except you provide a workaround to switch to guid.text (see my post in other thread).
I bear with you :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants