Good Morning, I have a column in a table which increments on success.In my service layer I have got
MyDomain myDomain = myDomainDAO.findById(myId);
myDomain.setValue(myDomain.getValue()+1);
myDAO.saveorupdate(myDomain);
secondary cache is switched off in my case. When multiple threads call to increment the value the results are inconsistent. Which can happen as hibernate threads will generate the sql in random and execute at random. I solved the problem using HQL. I would like to know how this can be achieved by the above code. Given that my secondary cache is off is there anyway to know the last save value in the database. Many Thanks