I use Java and MySql as a database.
I am running multiple instances of the application. I select one record from the database and at the same time after receiving it, I update its status "in process" so that no other instances can access this record.
But what happens is that the instances work so fast that when one instance accesses one record, another instance also accesses the same record before the update is performed in "In Process" by the first instance. What can I do to ensure that the update also takes place before another instance can access it? I used conn.setTransactionIsolation(conn.TRANSACTION_READ_COMMITTED)in my code, but it also does not help.
Thanks in advance.
source
share