Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lock wait timeout exceeded

 
Eugenia Lyaschuk
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, everyone
We use DB server: mysql,
web server: tomcat
framework: hibernate+spring+wicket

We have two applications on server that work with DB.
App1 gets data from client and puts it in DB.
App2 is a web application, shows data, that was inserted or updated by App1.

App1 transaction period, something about 3 sec. And if app2 will query data in this period, sometimes, it throws:
"java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction"

I've tried to set hibernate.connection.isolation in persistence.xml for App2, but it doesn't help.
I suppose, that this property is not considered. Because, when I set
<property name="hibernate.connection.isolation" value="0"/>
I expected to get "java.sql.SQLException: Transaction isolation level NONE not supported by MySQL", but everything was ok.

Please, tell me what am I doing wrong.
P.s. sorry for my english.
 
Eugenia Lyaschuk
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also I've forgot to wright, that I set

  • transaction-isolation=READ-COMMITTED
  • innodb_locks_unsafe_for_binlog=READ-COMMITTED

  • in my.ini file
     
    Eugenia Lyaschuk
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I've resolved this problem. It turned out, that I had to set

  • defaultTransactionIsolation="READ_COMMITTED"

  • in context.xml.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic