Should I use synchronize when making multiple database connections and queries at the same time using java?
For example I have implemented the following method:
public static void createAccount() throws IOException, SQLException {
DbManager.createDatabaseConnection();
DbManager.executeSqlUpdateStatement(Account_Creation_Scripts.createAccount_Sql_Command());
DbManager.closeDatabaseConnection();
}
The above method does its job to connect to the Database and create multiple accounts.
My plan is to use this method across multiple automation tests (Concurrently) which would run this method at the same time against the target db.
Is it good practise to implement the synchronize keyword on the following methods: createAccount, createDatabaseConnection, executeSqlUpdateStatement and closeDatabaseConnection?
Thanks