| I use Hibernate integrated with Spring, so this issue may or may not be just related to Hibernate. I noted that SQLException with SQL state 72000 and error code 08177 in Oracle, which means failure to commit a transaction on a SERIALIZABLE isolation level after data has been modified, is not translated by Hibernate into a specific HibernateException such as PessimisticLockException. Running a serializable transaction with Spring's @Transactional with same isolation on other DBs (e.g. SQL Server, Postgres) correctly converts the DB error code into the correct Spring's CannotSerializeTransactionException. I understand I am mainly talking about Spring Data, but since it is deeply coupled with Hibernate I have the suspect that handling such Oracle error code better requires an improvement in Hibernate's code rather than Spring. |