When I run Update the eclipse for execution

Asked

Viewed 80 times

0

When arriving at the part that executes the following query the system stops and does not proceed to the next line.

@Query(value = " UPDATE COOBILING_NUMBER SET CONDITION='Used' WHERE NUMBER_PHONE= ?1", nativeQuery = true)
public void update(String number);

What is the probable error ?

org.springframework.orm.jpa.JpaSystemException: could not execute query; nested exception is org.hibernate.exception.GenericJDBCException: could not execute query
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:333)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:491)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133)
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)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy73.update(Unknown Source)
at br.com.oiinternet.oitestautomation.sga.page.PaymentCobillingPage.fillDddAndCollectionPhone(PaymentCobillingPage.java:64)
at br.com.oiinternet.oitestautomation.sga.test.PurchaseCobillingTest.purchasePlanCobilling(PurchaseCobillingTest.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

Caused by: org.hibernate.Exception.Genericjdbcexception: could not execute query at org.hibernate.Exception.internal.Standardsqlexceptionconverter.Convert(Standardsqlexceptionconverter.java:47) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.Convert(Sqlexceptionhelper.java:109) at org.hibernate.Loader.Loader.doList(Loader.java:2620) at org.hibernate.Loader.Loader.doList(Loader.java:2600) at org.hibernate.Loader.Loader.listIgnoreQueryCache(Loader.java:2429) at org.hibernate.Loader.Loader.list(Loader.java:2424) at org.hibernate.Loader.custom.Customloader.list(Customloader.java:336) at org.hibernate.Internal.SessionImpl.listCustomQuery(Sessionimpl.java:1967) at org.hibernate.Internal.AbstractSessionImpl.list(Abstractsessionimpl.java:322) at org.hibernate.Internal.SQLQueryImpl.list(Sqlqueryimpl.java:125) at org.hibernate.jpa.internal.Queryimpl.list(Queryimpl.java:606) at org.hibernate.jpa.internal.Queryimpl.getSingleResult(Queryimpl.java:529) at sun.reflect.Nativemethodaccessorimpl.invoke0(Native Method) at sun.reflect.Nativemethodaccessorimpl.invoke(Unknown Source) at sun.reflect.Delegatingmethodaccessorimpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.Orm.jpa.Sharedentitymanagercreator$Deferredqueryinvocationhandler.invoke(Sharedentitymanagercreator.java:372) at com.sun.proxy. $Proxy81.getSingleResult(Unknown Source) at org.springframework.data.jpa.Repository.query.Jpaqueryexecution$Singleentityexecution.doExecute(Jpaqueryexecution.java:206) at org.springframework.data.jpa.Repository.query.Jpaqueryexecution.execute(Jpaqueryexecution.java:78) at org.springframework.data.jpa.Repository.query.Abstractjpaquery.doExecute(Abstractjpaquery.java:102) at org.springframework.data.jpa.Repository.query.Abstractjpaquery.execute(Abstractjpaquery.java:92) at org.springframework.data.repository.core.support.Repositoryfactorysupport$Queryexecutormethodinterceptor.doInvoke(Repositoryfactorysupport.java:482) at org.springframework.data.repository.core.support.Repositoryfactorysupport$Queryexecutormethodinterceptor.invoke(Repositoryfactorysupport.java:460) at org.springframework.aop.framework.Reflectivemethodinvocation.proceed(Reflectivemethodinvocation.java:179) org.springframework.data.projection.Defaultmethodinvokingmethodinterceptor.invoke(Defaultmethodinvokingmethodinterceptor.java:61) at org.springframework.aop.framework.Reflectivemethodinvocation.proceed(Reflectivemethodinvocation.java:179) at org.springframework.transaction.interceptor.Transactioninterceptor$1.proceedWithInvocation(Transactioninterceptor.java:99) at org.springframework.transaction.interceptor.Transactionaspectsupport.invokeWithinTransaction(Transactionaspectsupport.java:280) org.springframework.transaction.interceptor.Transactioninterceptor.invoke(Transactioninterceptor.java:96) at org.springframework.aop.framework.Reflectivemethodinvocation.proceed(Reflectivemethodinvocation.java:179) at org.springframework.dao.support.Persistenceexceptiontranslationinterceptor.invoke(Persistenceexceptiontranslationinterceptor.java:136) ... 46 more Caused by: java.sql.Sqlexception: ORA-01002: out-of-sequence extraction

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:225)
at oracle.jdbc.driver.T4CPreparedStatement.fetch(T4CPreparedStatement.java:1066)
at oracle.jdbc.driver.OracleStatement.fetchMoreRows(OracleStatement.java:3716)
at oracle.jdbc.driver.InsensitiveScrollableResultSet.fetchMoreRows(InsensitiveScrollableResultSet.java:1015)
at oracle.jdbc.driver.InsensitiveScrollableResultSet.absoluteInternal(InsensitiveScrollableResultSet.java:979)
at oracle.jdbc.driver.InsensitiveScrollableResultSet.next(InsensitiveScrollableResultSet.java:579)
at org.hibernate.loader.Loader.processResultSet(Loader.java:968)
at org.hibernate.loader.Loader.doQuery(Loader.java:930)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
at org.hibernate.loader.Loader.doList(Loader.java:2617)
... 75 more
  • No way to put a Try except to better see the error that is occurring?

  • Then but in this case it does not drop any error, it only gets stopped on the line that runs the UPDATE

  • Try { Database.update("37158755"); } catch (Exception e) { // TODO: Handle Exception }

  • If you are giving timeout, try to access the database to see if it is active or if there is no lock.

  • @Giulianabezerra how to make sure there is no lock ? Thanks for the tip !

  • Which DBMS do you use? Depending on the bank you have an option to view the active Ocks. If it is Postgres, for example, in Pgadmin you can view.

  • @Giulianabezerra Use Oracle, Parace that is not Lock pq problem I tried to run right at the beginning and from the same error.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.