-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Database Lockwait Timeout in production. Need help instantly
PostPosted: Wed Apr 14, 2004 6:15 am 
Newbie

Joined: Tue Oct 21, 2003 11:49 am
Posts: 3
Hi,

We have created a large order, stock, delivery business system who's core is HIbernate, Struts and MySql.

From time to time a lock wait timeout occurs. Sometime daly and sometime weekley. We haven't seen anything special that triggers the behaviour, but when the system get locked it won't help restarting the database. The main application running Hibernate must be restarted to get the the system working again.

Shouldn't the system start working again after the timeout passed?

We have thought of uppgrading the MySql JDBC driver? Any more ideas?

Thanks
Christian Heijkenskj


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 14, 2004 10:48 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Web application must never use app level locking, you need to find the way to implement the same, but without lock.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 3:19 am 
Newbie

Joined: Tue Oct 21, 2003 11:49 am
Posts: 3
Thanks for the reply.
May I ask why not using app level lockning?

We start a transaction, sometimes use these locks, and commit or rollback the transaction. We save the current transaction for each thread in a threadlocal variable to use the same transaction during the call/thread lifetime. As many complex inserts, updates and deletes can occur during a transaction, what do you recommend?

My hope using hibernate locking was to be able to scale the system later using standard methods...

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 15, 2004 9:49 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
There a lot of workaraunds to avoid dealocks, It depends on concurency control implementation in RDBMS and DB schema and I can not to recomend something specific, but probably
"Lock wait timeout exceeded; Try restarting transaction" doe's not mean
dealock, it looks like some uncomited transaction doe's not release exclusive lock ("SELECT ... FOR UPDATE" is an exclusive lock in mysql and it blocks reads too, web applications more read than write data and it can make web application to hung after thread pool starts to wait for a free thread)
Do you commit transactions in "Filter" or use some transaction demarcation antipattern from petstore ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.