2) there could be NoRowsAffectedException. What we know is UPDATE statement affected 0 rows but we don't know for what reason (and you might not use optimistic locking at all).
Why should I not use optimistic locking? In the Admin Guide "CHAPTER 4 Transactions on JBoss - The JTA Transaction Service" it is mentioned as an alternativ to pessimistic locking.
In my app I get sometimes deadlocks mostly on getting entities by different transactions. This could be solved by optimistic locking. On deadlock my app is hanging for a while (until timeout). An optimistic locking conflicting would happen immediately.
Why should I not use optimistic locking?
Did I say you should not? Don't understand your question.
Sorry, I read too fast! Please forget my last question - next time I will read more carefully.