I have a legacy database, and i cant change this particular Trigger on the DB.
When i update a Entity, the trigger answers with 2 returns
Code:
(0 row(s) affected)
(1 row(s) affected)
Hibernate is just catching the first return (the one with "0 rows affected"), and then throws a exception. I want to disable this hibernate check, how can i do that ?
Obs.: Change the trigger is not a option, i cant change the database
My resume stack trace:
Code:
Hibernate:
update
Pessoaf
set
ClassificacaoPessoa=?,
DataNasc=?,
CodGrauEscol=?,
CodPais=?,
Sexo=?
where
CodParceiro=?
javax.persistence.RollbackException: Error while commiting the transaction
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)
at br.com.integrativa.logic.UsuarioLogic.persistir(UsuarioLogic.java:226)
....
Caused by: javax.persistence.OptimisticLockException
at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:650)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:59)
... 37 more
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [br.com.integrativa.persistence.model.parceiro.PessoaFisica#2040513]
at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1765)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2407)