Can two applications access the same record at once from same databse with READLOCK?

74 Views Asked by At

I have a java application and when two instances of the application trying to start at once, i get the following error.This is mainly because both are accessing the same record.But isn't ReadLock is shared therefore multiple users can access it at one?

database.DatabaseLockException: Database locked. ErrorCode:'LOCKED' (Caused by com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException: Deadlock: wsrep aborted transaction) (vendorErrorCode: 1213) (problemStatement: SELECT ID,Licence_Id,Installation_Id,Generation_Date,Valid_From,Expiry_Date FROM Licences WHERE (Valid_From <= ? AND Expiry_Date >= ?) ORDER BY Generation_Date DESC)

0

There are 0 best solutions below