1

Anyone knows what causes this error?

Been struggling with this issue since morning. This error just started and prevents fetching from the DB. After researching i found this link but he just says it was an OPTIMISTIC_LOCK and does not specify how to fix it. When i debug, i notice that i fetch some data then the error shows. The data is in the DB and i am struggling. Please assist: The link i found on internet is below: Transaction cannot proceed STATUS_MARKED_ROLLBACK when running on jboss standalone

11:32:39,036 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-38) SQL Error: 0, 
SQLState: null
11:32:39,038 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-38) IJ031070: 
Transaction cannot proceed: STATUS_MARKED_ROLLBACK
11:32:39,043 INFO  [org.hibernate.event.internal.DefaultLoadEventListener] (default task-38) 
HHH000327: Error performing load command : org.hibernate.exception.GenericJDBCException: could not 
prepare statement
11:32:39,046 ERROR [org.jboss.as.ejb3.invocation] (default task-38) WFLYEJB0034: EJB Invocation 
failed on component MyClassImpl for method public abstract com.service.api.entities.ClassDto com.service.api.MyClassApi.myMethod(com.service.api.entities.Dto,java.lang.Object,com.model.user,java.lang.String) throws com.service.api.exceptions.MyException: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: could not prepare statement
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:159)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:256)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:329)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
Evil_skunk
  • 3,040
  • 4
  • 30
  • 42
Carol
  • 61
  • 1
  • 3
  • 11
  • How well do you understand transactions? – Kayaman Mar 21 '20 at 11:07
  • 2
    @Kayaman it seem not as much. Please explain if you have a broader understanding – Carol Mar 21 '20 at 11:20
  • 1
    Well, something (an error, or an explicit rollback) has happened to your ongoing transaction to have it marked as rolled back. You're trying to then perform an operation, but the database won't allow it and you get the exception. You need to examine logs and any other information you can gather to find your root problem, what you're seeing here is just a...side effect so to speak. – Kayaman Mar 21 '20 at 11:26
  • Thanks i will continue to debug and troubleshoot more – Carol Mar 21 '20 at 11:31
  • Hi, any findings? – alex Mar 16 '21 at 09:02
  • Probably a long transaction that exceeded the timeout (as specified in JBoss). – Lluis Martinez Nov 17 '22 at 19:56

1 Answers1

0

While you are debugging, transaction can lost connection because of timeout. In my situation, I removed the breakpoints before the transaction statement, the mentioned error has gone.

ÖMER TAŞCI
  • 546
  • 5
  • 9