I’ll be using a multi-threaded Java program to insert new records to a table in MySQL. Is it necessary to synchronize for this? Or is it OK since each insert is a different record in my case?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The database driver will do this for you under the covers, if it is necessary. You should assume that the database can handle concurrent CRUD access.
The drivers I’ve used for SQLServer and Sybase have always locked the
Connectionobject, although you could be using multiple connections via a pool of course!