Bug hibernate - erro fuminante :(

3 respostas
hvivox

Olá pessoal, só experiente no hibernate mesmo assim não consigo resolver o erro mostrado abaixo:

org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update

at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)

at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)

at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)

at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)

at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)

at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)

at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)

at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)

at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)

at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)

at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)

at br.com.belsystem.dao.DaoRecebimento.salvar(DaoRecebimento.java:27)

at br.com.belsystem.controle.ControleRecebimento.ControleSalvarAtendeAberto(ControleRecebimento.java:130)

at br.com.belsystem.visao.TelaMovimentoCaixa.registrarRecebimento(TelaMovimentoCaixa.java:1108)

at br.com.belsystem.visao.TelaMovimentoCaixa$2.actionPerformed(TelaMovimentoCaixa.java:201)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)

at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at javax.swing.JComponent.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

Caused by: java.sql.BatchUpdateException: Lock wait timeout exceeded; try restarting transaction

at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1669)

at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1085)

at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)

at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)

 37 more

Isso ocorre somente quando tento persistir dados em uma entidade especifica chamada recebimento, em que persisto dadaos nas diversas entidades do meu sistema e isso não ocorre. Estou utilizando o .save() para persistir. Outra informação importante é que consigo inserir alguns registros na entidade Recebimento depois disso toda vez que tento persistir algo o erro citado é mostrado. Não sei mas o que fazer por isso peço ajuda de todos para resolver essa situação que pode ser um bug do hibernate…

grato,

3 Respostas

hvivox

Esse erro trava aplicação por alguns minutos!

Marky.Vasconcelos

Verifique se voce não esta adicionando o mesmo objeto varias vezes a session(update ou save) antes de fechar a sessão.

Ou então se voce esta fazendo um update sem estar salvo.

C

Dê uma depurada no try catch que captura este erro, e veja qual o erro específico.
Normalmente ele é o cause dessa exception genérica que o hibernate lança.

Criado 19 de julho de 2009
Ultima resposta 20 de jul. de 2009
Respostas 3
Participantes 3