Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LockTimeoutException: could not acquire lock on @Synchronized component

 
Sudha Ramasamy
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid your problem is most likely in your application code. JSF doesn't do much in the way of synchronization.
 
Sudha Ramasamy
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic