|
|
Rank: Newbie Coder Groups: Member
Joined: 3/1/2009 Posts: 10 Points: 30 Location: Nigeria
|
Hi all, I am working on a project that see me using WebOrb to do bulk inserts and also checking before insert if the record exist already. This I have done. And what I did was:
Create the object, check if it exist and write it to the database (this is done on the load even of the ArrayCollection)
Since there is no way yo do this synchronously, what would you suggest?
|
|
Rank: Newbie Coder Groups: Member
Joined: 5/31/2012 Posts: 7 Points: 18 Location: Portugal - Lisbon
|
Hey there.
I couldn't understand were exactly was your problem. Was it on checking the records after inserting a new one? Or was it loading the records (with the new ones) after inserting then?
Cheers
|
|
Rank: Newbie Coder Groups: Member
Joined: 3/1/2009 Posts: 10 Points: 30 Location: Nigeria
|
The challenge I have is this. I want to display a progress bar for the insert but I cant. I dont knw when all the items are saved to the database to that I can return a message that says all items are saved. for example for each(var selectedStudent:Object in _StudentsList) { //obj.toString(); for each(var subs:Object in _ClassSubjects) { // Save students against subject here // but check first SaveAssessment(subs.SubjectName, selectedStudent as Students,txtAssessType.text); } }
|
|
Rank: Newbie Coder Groups: Member
Joined: 3/1/2009 Posts: 10 Points: 30 Location: Nigeria
|
The challenge I have is this. I want to display a progress bar for the insert but I cant. I dont knw when all the items are saved to the database to that I can return a message that says all items are saved. for example for each(var selectedStudent:Object in _StudentsList) { //obj.toString(); for each(var subs:Object in _ClassSubjects) { // Save students against subject here // but check first SaveAssessment(subs.SubjectName, selectedStudent as Students,txtAssessType.text); } }
|
|
Rank: Newbie Coder Groups: Member
Joined: 5/31/2012 Posts: 7 Points: 18 Location: Portugal - Lisbon
|
Hey there
I had a similar problem, the best solution for me to keep track of the progress was a counter in the save process
for (var i:int = 0; i{ SaveFunction(); }
I could keep track of the progress with the i variable, depending on where you want to keep track just put the variable on the first or the second for. Note that the fact that the variable has been incremented does not mean that the record will be on you DataBase, you're only sure that the request has been made. If you want to be sure the record is there use an AsyncToken with you save.
Let me know if it helps.
Cheers
|
|
Rank: Newbie Coder Groups: Member
Joined: 3/1/2009 Posts: 10 Points: 30 Location: Nigeria
|
It did help. I had that in mind somehow, just felt there should prolly be a better way.
Thanks a lot!
|
|
|
Guest |