-
1. Re: could not acquire lock on @Synchronized, help me.
swd847 Feb 18, 2009 11:06 PM (in response to sherkan777)Session scoped components are automatically Synchronized, so multiple threads cannot access then at once. If a thread is waiting two long to acquire a lock that exception will get thrown.
-
2. Re: could not acquire lock on @Synchronized, help me.
blabno Feb 19, 2009 10:24 AM (in response to sherkan777)I've run at the same problem when I was writing module that took a long time to perform some task and other component was trying to access the busy component (i.e. on page refresh). I suggest running that task in separate thread. Note that when you use @Asynchronous annotation to fire method in async mode, then it does not have access to conversation scope. You might find it easier sometimes to create separate thread by hand and set it up right.
-
3. Re: could not acquire lock on @Synchronized, help me.
sherkan777 Feb 19, 2009 11:12 AM (in response to sherkan777)So only way is to set bigger timeout using @Synchronized at bean begin in this case (if I use SESSION scope bean).
@Stateful @Scope(ScopeType.SESSION) @Name("xxxxx") @Synchronized(timeout=10000)
but in conversation state each conversation is separated thread and this it not necesary. Am I right?
-
4. Re: could not acquire lock on @Synchronized, help me.
swd847 Feb 19, 2009 11:41 AM (in response to sherkan777)yes, I think there is some way to remove the synchronization but I cannot remember it off the top of my head, you would have to check the docs. If you do this the you will have to deal with thread safety issues yourself though.