0

I'm getting StaleObjectStateException on my update operation on a domain model that has Optimistic Locking disabled.

So it does not have the version column.

I'm under the impression that it would not check at all if the object is stale.

I disabled the optimistic locking by adding this to the domain model:

static mapping = {
    version false
}
froi
  • 7,268
  • 5
  • 40
  • 78
  • Should you not attempt to fix underlying issue rather than disabling this. http://stackoverflow.com/questions/39296682/grails-transactions-and-the-session/39297300#39297300 try following .With New transaction as shown on above question. You may want to get object again within .With New transaction and updating/saving the new object within the block – V H Sep 14 '16 at 19:13
  • In this specific case, we intentionally do not want optimistic locking since we do not care for it on that specific domain model. – froi Sep 14 '16 at 20:01

0 Answers0