How to handle GORM exceptions
问题 I'm trying to implement exception handling for Optimistic lock type exceptions that are thrown by Hibernate but I've encountered a strange issue. It seems I'm unable to catch any Gorm exceptions. For example I have this code in my service: try { User user = User.get(1); Thread.sleep(10000); user.viewedAt(new Date()); user.save(flush:true); } catch (OptimisticLockingException ex) { log.error("Optimistic lock exception"); } catch (StaleObjectStateException ex) { log.error("Optimistic lock