Caused by: java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation

Many times we encounter this error and think that there might be some JPA issue or network issue. However, the error is pretty explicit in its nature, but still not clear to ring the bell very first time.
As the error says there is a timeout, and since Oracle is saying, we shall accept it.

Another clue is "user requested cancel of current operation". This means that the connection was closed by the application server not the database server, hence it can be safely concluded that application has configured timeouts on transactions at its end.

However, if you feel that this transaction should have been concluded within the application server limits, your doubt might be true.

This problem can arise in case there is a lock on the record being updated by JPA or lock on the table in which JPA is attempting to insert. The lock is most probably being held by some other application, and since application server configuration is on aggressive SLA, the transaction is waiting itself out.


 Exception : org.springframework.dao.QueryTimeoutException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.QueryTimeoutException: could not execute statement  
 at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:265)  
  at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)  
  at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:521)  
  at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)  
  at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)  
  at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:504)  
  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:292)  
  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)  
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)  
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
 Caused by: org.hibernate.QueryTimeoutException: could not execute statement  
  at org.hibernate.dialect.Oracle8iDialect$3.convert(Oracle8iDialect.java:532)  
  at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)  
  at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)  
  at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95)  
  at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:207)  
  at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3139)  
  at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:3013)  
  at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3393)  
  at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:145)  
  at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:582)  
  at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:456)  
  at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)  
  at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)  
  at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1282)  
  at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:465)  
  at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:2963)  
  at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2339)  
  at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:485)  
  at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:147)  
  at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)  
  at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231)  
  at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:65)  
  at org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:61)  
  at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517)  
  ... 127 more  
 Caused by: java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation  
  at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494)  
  at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:446)  
  at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1054)  
  at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:623)  
  at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252)  
  at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612)  
  at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:226)  
  at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:59)  
  at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:910)  
  at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1119)  
  at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3780)  
  at oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1343)  
  at oracle.jdbc.driver.OraclePreparedStatement.executeLargeUpdate(OraclePreparedStatement.java:3865)  
  at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3845)  
  at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1061)  
  at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:204)  
  ... 146 more  
 Caused by: Error : 1013  

Comments

Popular posts from this blog

pandas dataframe add missing date from range in a multi-dimensional structure with duplicate index

utility to extract date from text with java