Re: [os-libsynthesis] resume + double Add

2010-03-04 Thread Patrick Ohly
On Fri, 2010-02-26 at 15:05 +, Patrick Ohly wrote:
[...]
 So it seems that the engine does check for the remote ID, but only after
 having already added the item again.

I think this was due to not enabling resumesupport. After setting
that, the same test passes. Sorry for the confusion - I hadn't quite
realized that suspend/resume was optional.

Shouldn't the server have refused to resume with resumesupport off?
Just wondering, we'll certainly turn it on now...

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



___
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis


Re: [os-libsynthesis] resume + double Add

2010-03-04 Thread Lukas Zeller
Hi Patrick,

On Mar 4, 2010, at 18:49 , Patrick Ohly wrote:

 On Fri, 2010-02-26 at 15:05 +, Patrick Ohly wrote:
 [...]
 So it seems that the engine does check for the remote ID, but only after
 having already added the item again.
 
 I think this was due to not enabling resumesupport. After setting
 that, the same test passes. Sorry for the confusion - I hadn't quite
 realized that suspend/resume was optional.

As said in the previous message, yes, for the server it is optional.

However, while tracking through the code I found that indeed in the server, the 
case of a client sending duplicate Adds was not handled at all. So even with 
resumesupport a repeated add from the client IMHO would have created a 
duplicate in the server DB.
As most clients always send Replace (including libsynthesis not so long ago), 
this case did not surface.

I now added a check for that in 3e687ddfca (server engine: added missing check 
for re-sent Add during resume.)

 Shouldn't the server have refused to resume with resumesupport off?

Yes. However, when you use a admin data plugin, dsResumeSupportedInDB() is 
checking the API version of the plugin:

pluginapids.cpp:941:

 /// returns true if DB implementation supports resume (saving of resume 
 marks, alert code, pending maps, tempGUIDs)
 bool TPluginApiDS::dsResumeSupportedInDB(void)
 {
   if (fPluginDSConfigP-fDBApiConfig_Admin.Connected()) {
 // we can do resume if plugin supports it
 return 
 fPluginDSConfigP-fDBApiConfig_Admin.Version()=sInt32(VE_InsertMapItem);
   }
   return inherited::dsResumeSupportedInDB();
 } // TPluginApiDS::dsResumeSupportedInDB
 


...and resumesupport is irrelevant (so what I said in the previous message is 
not entirely correct - old plugins will AUTOMATICALLY disable resume; 
resumesupport is only relevant for SQL backends).

So it's even stranger that enabling resumesupport should have made the tests 
to pass now. ???


Lukas Zeller (l...@synthesis.ch)
- 
Synthesis AG, SyncML Solutions   Sustainable Software Concepts
i...@synthesis.ch, http://www.synthesis.ch





___
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis


Re: [os-libsynthesis] resume + double Add

2010-03-04 Thread Patrick Ohly
On Thu, 2010-03-04 at 23:49 +, Lukas Zeller wrote:
 On Mar 4, 2010, at 18:49 , Patrick Ohly wrote:
 
  On Fri, 2010-02-26 at 15:05 +, Patrick Ohly wrote:
 However, while tracking through the code I found that indeed in the
 server, the case of a client sending duplicate Adds was not handled
 at all. So even with resumesupport a repeated add from the client
 IMHO would have created a duplicate in the server DB.
 As most clients always send Replace (including libsynthesis not so
 long ago), this case did not surface.
 
 I now added a check for that in 3e687ddfca (server engine: added
 missing check for re-sent Add during resume.)

Then my testing wasn't all in vain, even though it doesn't seem to be
100% reliable - see below.

I'll continue testing with your patch included.

 ...and resumesupport is irrelevant (so what I said in the previous
 message is not entirely correct - old plugins will AUTOMATICALLY
 disable resume; resumesupport is only relevant for SQL backends).
 
 So it's even stranger that enabling resumesupport should have made
 the tests to pass now. ???

I also enable blob support, but that shouldn't be relevant for these
tests. But I might have been wrong about it working: rerunning it shows
that the results are not always reproducable. I need to look into that.

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



___
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis