-
1. Re: No more: could not aquire lock on @Sycronized errors
kragoth Nov 5, 2009 12:14 AM (in response to luxspes)1 minute seems an awefully long time to be waiting for a lock. Unless you have got reports or heavy processing happening on a button click.
We farm our heavy processes off to another thread or don't use ajax to make the call. Just lock the app up while the processing goes on. I guess the idea behind the 1 second is that ajax requests should be very light weight. Otherwise you risk getting your page out of synch because the user has control of a page where the information being displayed is not complete.
I do agree that 1 second can still be a bit short for even light weight ajax requests. I've experienced it on a simple list refresh handled by ajax. But, all my problems went away with a single ajax queue.
Ok.... I'm done ranting now. :P
I don't think you should remove your ajax queue. The ajax queue is not there just to stop your synch errors. If you use the oncomplete functionality of the ajax request the queue is still useful. Otherwise you're javascript will be potentially working on a incomplete/partially modified DOM. There's probably a lot of other reasons to stick with the queue too but.... I'm still waking up :P
-
2. Re: No more: could not aquire lock on @Sycronized errors
luxspes Nov 5, 2009 4:38 PM (in response to luxspes)
Tim Evers wrote on Nov 05, 2009 00:14:
1 minute seems an awefully long time to be waiting for a lock. Unless you have got reports or heavy processing happening on a button click.Yes, I though that too, at first, I set it to 2 seconds (because I had many cases where I needed to wait for that), then as load increased and more features were tested, I had some cases that needed 3 seconds... then some that needed 4 seconds... then some that needed 7 seconds.... then some that sometimes (low load) needed 3 seconds, and sometimes needed 8 seconds (high load), and then another one that needed 9 seconds, but sometimes it... you get the idea, so I decided to set it to 1 minute, and wait and see if I got any complaints from users... so far, they are completely happy (apparently the risks of having locks wainting 1 minute have a much lower probability of causing problems than the
Could not acquire lock on @Synchronized
errors. I wonder if that is the case only for my applications of it is something typical of Seam applications...
We farm our heavy processes off to another thread or don't use ajax to make the call. Just lock the app up while the processing goes on. I guess the idea behind the 1 second is that ajax requests should be very light weight. Otherwise you risk getting your page out of synch because the user has control of a page where the information being displayed is not complete.Yes, that certainly seems like the right thing to do from a theoretical POV, but in practice that means modifing dozens of pages (hundreds of line of code) just because maybe some processes, while under load, is going to take 7 seven seconds instead of 2 seconds. Simply setting it to 1 minute and wainting for complains from the user (and the optimize) seems like a more sensible choice.
I do agree that 1 second can still be a bit short for even light weight ajax requests. I've experienced it on a simple list refresh handled by ajax. But, all my problems went away with a single ajax queue.
Ok.... I'm done ranting now. :PYes, ajax queues help a lot, they solved around 75% to 85% of my
Could not acquire lock on @Synchronized
errors, but setting the default timeout of Synchronized elements seems to have solved the remaining 15% to 25% of my problems...
I don't think you should remove your ajax queue. The ajax queue is not there just to stop your synch errors. If you use the oncomplete functionality of the ajax request the queue is still useful. Otherwise you're javascript will be potentially working on a incomplete/partially modified DOM. There's probably a lot of other reasons to stick with the queue too but.... I'm still waking up :PI do use the oncomplete to preserve focus, so I guess I will keep my ajax queue for while...
Thanks a lot for answering