Do I need to synchronize if I have multiple threads to be inserted into MySQL?

I will be using a multithreaded Java program to insert new records into a table in MySQL. Do I need to sync for this? Or is it ok, since each insert is a different record in my case?

+2


source to share


1 answer


The database driver will do this for you under the covers if needed. You must assume that the database can handle concurrent CRUD access.



The drivers I used for SQLServer and Sybase always closed the object Connection

, although you could use multiple pooled connections, of course!

+6


source







All Articles