|
I think the basic problem is that when you
have integer ids, FDMS does not treat “0” as the “null”
id since in some cases 0 is a perfectly valid id. When you use createItem, in
some cases the client allocates the ids though more commonly they are allocated
by the server and updated in the client side when the commit result returns. For
String ids, null is a signal to FDMS to expect a server side id on the commit
so we create a temporary unique id in the meantime for that instance. But with
integer ids if you call createItem twice in a row before committing you’ll
end up with two objects that have 0 as their id and that is considered an
error. We should have a way to indicate that “0” is a null id….
In any case, I have worked around this in the past by using an ascending
sequence of negative numbers for the ids of newly created items. You just some
need some integer which gets decremented each time you call createItem and use
that value as your “id” before you call createItem. That way the
ids are unique before the commit call is made as well as after. Of course that could cause problems if
your server allocates negative id values as well but hopefully that is not the
case. Jeff From:
[email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Benno Kittelmann Hello
all, -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |
- RE: [flexcoders] Add an object via DataService.createItem... Jeff Vroom
- Re: [flexcoders] Add an object via DataService.creat... Benno Kittelmann
- Re: [flexcoders] Add an object via DataService.c... Benno Kittelmann
- RE: [flexcoders] Add an object via DataService.c... Jeff Vroom

