This content has been marked as final. Show 3 replies
When you hit the button, don't add it to the ComboBox - make the request to the server and in the HTTPService result handler, add the value to the ComboBox. This way you are guaranteed the value to be in the database.
First of all I think the implementation on your server side is not "perfect" :). You're probably not using transaction controll correctly or something. Anyway, Perter's suggestion is (IMO) a better way, except that I'd like to add to it is it's not too clear.
(Assuming you're "programming to exceptions" meaning that if you're executing a line of code, then the line before it executed just fine)
1. Post the new record to the database first.
2. Add the new record to your combo box.
In other words, there is no need to reload the entire record set each time you add a single record. Of course that's the general thing. In a multi-user environment (and depending on your reconcilliation rules) you may want to re-load just in case some other users also added new records.
my two cents.
I think peter is right.
Because if 100 users adds records in a mean time Surely U wanna see Real Time Data.
So it is mandatory to get always updated data from the server.