File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes LockTimeoutException: could not acquire lock on @Synchronized component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "LockTimeoutException: could not acquire lock on @Synchronized component" Watch "LockTimeoutException: could not acquire lock on @Synchronized component" New topic
Author

LockTimeoutException: could not acquire lock on @Synchronized component

Sudha Ramasamy
Greenhorn

Joined: May 05, 2011
Posts: 10
Hello,
In my application I'm getting the error
LockTimeoutException: could not acquire lock on @Synchronized component very often, but I couldn't try to reproduce it consistently,
I'm using a4j:form in my JSF,
Does anyone know whether queuing is related to a4j:form or h:form ?

any help is appreciated,

Thanks,
Sudha
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

I'm afraid your problem is most likely in your application code. JSF doesn't do much in the way of synchronization.


Customer surveys are for companies who didn't pay proper attention to begin with.
Sudha Ramasamy
Greenhorn

Joined: May 05, 2011
Posts: 10
hi Tim,

Thanks for the reply,

when i was browsing internet for this issue, just came across the following thread

https://issues.jboss.org/browse/RF-8468

where they say about eventsQueue configuration in a4j:form,
but i couldn't exactly understand that,

if we configure eventsQueue for a form, will it help preventing synchronization lock from happening?

Thanks,
Sudha
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

The a4j:form tag is obsolete. You can use h:form. It won't help your problem, just wanted to let you know.

The example you referenced appears to be a deliberate attempt to create a timeout. The user set up a synchronized object that held sync for a ridiculously long time and the second request timed out waiting for the first request to give up the sync lock.

The RichFaces queueing mechanism is done on the client side and in JavaScript, so it doesn't synchronize directly. The main thing is that any synchronized method should execute quickly. Aside from the timeout issues, synchronized code chokes up the normal multi-threaded processing and creates performance bottlenecks.
Sudha Ramasamy
Greenhorn

Joined: May 05, 2011
Posts: 10
Thanks for the reply Tim,

I have to change it to h:form and configure <a4j:queue> and see if that helps me

Regards,
Sudha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: LockTimeoutException: could not acquire lock on @Synchronized component
 
Similar Threads
synchronization quesion
Doubt in one question
Locks
class level in synchronized blocks
synchronized block