Non-blocking MySQL updates with java?

Posted by justkevin on Stack Overflow See other posts from Stack Overflow or by justkevin
Published on 2010-05-15T11:59:05Z Indexed on 2010/05/15 12:04 UTC
Read the original article Hit count: 257

Filed under:
|
|
|
|

For a multiplayer game I'm working on I'd like to record events to the mysql database without blocking the game update thread so that if the database is busy or a table is locked the game doesn't stop running while it waits for a write.

What's the best way to accomplish this?

I'm using c3p0 to manage the database connection pool. My best idea so far is to add query update strings to a synchronized list with an independent thread checking the list every 100ms and executing the queries it finds there.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about java