Re: Hwo thread-safe is mysql's jdbc driver?
Posted by:
Mark Matthews ()
Date: September 04, 2007 06:29AM
Clemens,
While you _can_ share a connection across threads (especially if each thread has its own Statement), it's usually not a good idea. The JDBC API is not really designed to be used in a thread-safe way, and most JDBC connections (including MySQL's) can only process a single query at a time.
You'll be adding _more_ contention in your system rather than concurrency compared to just giving each thread a "private" connection.
-Mark
Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.