We a re using Grails which of course uses hibernate for its O/R.  In one instance we have multiple requests trying to delete the same object. The first thread will delete and the second thread that tries to delete the object throws a StaleStateException. This is as expected.  According to doc:

http://docs.jboss.org/hibernate/envers/3.6/javadocs/org/hibernate/StaleStateException.html

This exception:  Also occurs if we try delete or update a row that does not exist.

Now, in our case it is not an exception. We don't care it has already been deleted.  We don't want to have to put in a check before the delete and we just want to put in exception handling because it is not really an exception. 

What we would really like to do is not have this exception throw if a delete is attempted and the object is not there.

Is there any way to do this with Grails / Gorm?

The best ideal I have is to do the delete with just a bit of SQL of HSQL rather than use a hibernate / grails API.

Any better ones?


Question: What's the meaning of this sentence?
Answer: I had never heard the expression "once and again" before!

According to Merriam Webster, it has the following definitions:


  once and once more
  
  two or more times
  
  now and again, from time to time, occasionally, sometimes


In the context, it seems to have the third definition - which, until now, I knew as "now and again" (which makes just as little literal sense, when you think about it!) or "once in a while".

It could be the first definition - s/he had had the job once before, and now has it again - but this requires two tenses, meaning the sentence would have to be restructured:


  "who had once occupied, and once more occupied..." (or "who had once,
  and once more, occupied...")


Similarly, "two or more times" requires "had occupied:


  "who had occupied - two or more times - ..."


This dictionary has only one definition for "once and again":


  repeatedly, as in "He has been told once and again not to slam the
  door."


This just doesn't seem right in the example sentence, as we don't talk about someone "repeatedly" going to work or having a particular job - they just have the job, or work there "once in a while".