org.hibernate.exception.SQLGrammarException: could not execute query

Hibernate JIRA | Martin Šimka | 2 years ago
  1. 0

    org.hibernate.test.legacy.FooBarTest.testCollectionsInSelect fails on MS SQL Server 2014 More accurate version: Hibernate ORM 4.2.14.SP1 Stack trace: {noformat} org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) at org.hibernate.loader.Loader.doList(Loader.java:2553) at org.hibernate.loader.Loader.doList(Loader.java:2536) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366) at org.hibernate.loader.Loader.list(Loader.java:2361) at org.hibernate.hql.internal.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:942) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) at org.hibernate.test.legacy.FooBarTest.testCollectionsInSelect(FooBarTest.java:99) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting the varchar value 'ff808181490ec08101490ec21c6b0006' to data type int. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer.nextRow(SQLServerResultSet.java:4853) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLServerResultSet.java:1781) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:1034) at org.hibernate.loader.Loader.processResultSet(Loader.java:946) at org.hibernate.loader.Loader.doQuery(Loader.java:917) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348) at org.hibernate.loader.Loader.doList(Loader.java:2550) ... 20 more {noformat} I happens only when test testCollectionsInSelect runs after test testAutoFlushCollections It does not fail with SQL Server 2012. It also fails on 4.2 branch. I'm not sure if this is only test issue or legitimate issue.

    Hibernate JIRA | 2 years ago | Martin Šimka
    org.hibernate.exception.SQLGrammarException: could not execute query
  2. 0

    org.hibernate.test.legacy.FooBarTest.testCollectionsInSelect fails on MS SQL Server 2014 More accurate version: Hibernate ORM 4.2.14.SP1 Stack trace: {noformat} org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) at org.hibernate.loader.Loader.doList(Loader.java:2553) at org.hibernate.loader.Loader.doList(Loader.java:2536) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366) at org.hibernate.loader.Loader.list(Loader.java:2361) at org.hibernate.hql.internal.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:942) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) at org.hibernate.test.legacy.FooBarTest.testCollectionsInSelect(FooBarTest.java:99) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Conversion failed when converting the varchar value 'ff808181490ec08101490ec21c6b0006' to data type int. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer.nextRow(SQLServerResultSet.java:4853) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLServerResultSet.java:1781) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:1034) at org.hibernate.loader.Loader.processResultSet(Loader.java:946) at org.hibernate.loader.Loader.doQuery(Loader.java:917) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348) at org.hibernate.loader.Loader.doList(Loader.java:2550) ... 20 more {noformat} I happens only when test testCollectionsInSelect runs after test testAutoFlushCollections It does not fail with SQL Server 2012. It also fails on 4.2 branch. I'm not sure if this is only test issue or legitimate issue.

    Hibernate JIRA | 2 years ago | Martin Šimka
    org.hibernate.exception.SQLGrammarException: could not execute query
  3. 0

    many-to-many table + generation primary key in varbinary

    Stack Overflow | 1 year ago | mohammed cherif
    com.microsoft.sqlserver.jdbc.SQLServerException: Une erreur de d걡ssement arithm굩que s'est produite lors de la conversion de varbinary en type de donn꦳ numeric.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [cas-user] CAS 3.5.2 - SQL Deadlocks - Not cleanup related

    Google Groups | 2 years ago | Geoff Whittaker
    javax.persistence.PersistenceException: org.hibernate.exception.LockAcquisitionException: Transaction (Process ID 138) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
  6. 0

    When the import process tries to mark the imported archive for indexing it fails with a database deadlock: {code} java.lang.reflect.UndeclaredThrowableException: null at com.sun.proxy.$Proxy23.next(Unknown Source) ~[na:na] at org.artifactory.storage.db.fs.dao.TasksDao.exist(TasksDao.java:68) ~[artifactory-storage-db-3.0.2.jar:na] at org.artifactory.storage.db.fs.service.TasksServiceImpl.hasIndexTask(TasksServiceImpl.java:70) ~[artifactory-storage-db-3.0.2.jar:na] at org.artifactory.storage.db.fs.service.TasksServiceImpl.addIndexTask(TasksServiceImpl.java:79) ~[artifactory-storage-db-3.0.2.jar:na] at org.artifactory.search.archive.ArchiveIndexerImpl.markArchiveForIndexing(ArchiveIndexerImpl.java:211) ~[artifactory-core-3.0.2.jar:na] at sun.reflect.GeneratedMethodAccessor98.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_25] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_25] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.artifactory.storage.fs.lock.aop.LockingAdvice.invoke(LockingAdvice.java:66) ~[artifactory-storage-common-3.0.2.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE] at com.sun.proxy.$Proxy44.markArchiveForIndexing(Unknown Source) ~[na:na] at org.artifactory.repo.interceptor.ArchiveIndexingInterceptor.markArchiveForIndexing(ArchiveIndexingInterceptor.java:57) ~[artifactory-core-3.0.2.jar:na] at org.artifactory.repo.interceptor.ArchiveIndexingInterceptor.afterImport(ArchiveIndexingInterceptor.java:51) ~[artifactory-core-3.0.2.jar:na] at org.artifactory.repo.interceptor.ImportInterceptorsImpl.afterImport(ImportInterceptorsImpl.java:38) ~[artifactory-core-3.0.2.jar:na] at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_25] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_25] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE] at com.sun.proxy.$Proxy78.afterImport(Unknown Source) ~[na:na] at org.artifactory.repo.db.importexport.DbRepoImportHandler.importFile(DbRepoImportHandler.java:223) [artifactory-core-3.0.2.jar:na] at org.artifactory.repo.db.importexport.DbRepoImportHandler.importRecursive(DbRepoImportHandler.java:172) [artifactory-core-3.0.2.jar:na] at org.artifactory.repo.db.importexport.DbRepoImportHandler.importRecursive(DbRepoImportHandler.java:194) [artifactory-core-3.0.2.jar:na] at org.artifactory.repo.db.importexport.DbRepoImportHandler.importRecursive(DbRepoImportHandler.java:194) [artifactory-core-3.0.2.jar:na] at org.artifactory.repo.db.importexport.DbRepoImportHandler.importRecursive(DbRepoImportHandler.java:194) [artifactory-core-3.0.2.jar:na] at org.artifactory.repo.db.importexport.DbRepoImportHandler.importRecursive(DbRepoImportHandler.java:194) [artifactory-core-3.0.2.jar:na] at org.artifactory.repo.db.importexport.DbRepoImportHandler.importRecursive(DbRepoImportHandler.java:194) [artifactory-core-3.0.2.jar:na] at org.artifactory.repo.db.importexport.DbRepoImportHandler.importRecursive(DbRepoImportHandler.java:194) [artifactory-core-3.0.2.jar:na] at org.artifactory.repo.db.importexport.DbRepoImportHandler.executeImport(DbRepoImportHandler.java:124) [artifactory-core-3.0.2.jar:na] at org.artifactory.repo.db.DbLocalRepo.importFrom(DbLocalRepo.java:153) ~[artifactory-core-3.0.2.jar:na] at org.artifactory.repo.service.RepositoryServiceImpl.importRepo(RepositoryServiceImpl.java:758) ~[artifactory-core-3.0.2.jar:na] at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_25] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_25] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) ~[spring-aop-3.2.0.RELEASE.jar:3.2.0.RELEASE] at com.sun.proxy.$Proxy35.importRepo(Unknown Source) ~[na:na] at org.artifactory.repo.service.ImportJob.onExecute(ImportJob.java:108) ~[artifactory-core-3.0.2.jar:na] at org.artifactory.repo.service.ImportJob.onExecute(ImportJob.java:1) ~[artifactory-core-3.0.2.jar:na] at org.artifactory.schedule.quartz.QuartzCommand.execute(QuartzCommand.java:46) ~[artifactory-storage-common-3.0.2.jar:na] at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-1.6.6.jar:1.6.6] at org.artifactory.schedule.ArtifactoryConcurrentExecutor$RunnableWrapper.run(ArtifactoryConcurrentExecutor.java:91) ~[artifactory-storage-common-3.0.2.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_25] at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25] Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_25] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_25] at org.artifactory.storage.db.util.ResultSetWrapper.invoke(ResultSetWrapper.java:73) ~[artifactory-storage-db-3.0.2.jar:na] ... 49 common frames omitted Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Transaction (Process ID 59) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) ~[sqljdbc4.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer.nextRow(SQLServerResultSet.java:4853) ~[sqljdbc4.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLServerResultSet.java:1781) ~[sqljdbc4.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:1034) ~[sqljdbc4.jar:na] at org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207) ~[commons-dbcp-1.4.jar:1.4] at org.apache.commons.dbcp.DelegatingResultSet.next(DelegatingResultSet.java:207) ~[commons-dbcp-1.4.jar:1.4] ... 53 common frames omitted {code}

    JFrog JIRA | 3 years ago | Dror Bereznitsky
    java.lang.reflect.UndeclaredThrowableException: null

    9 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.microsoft.sqlserver.jdbc.SQLServerException

      Conversion failed when converting the varchar value 'ff808181490ec08101490ec21c6b0006' to data type int.

      at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError()
    2. com.microsoft.sqlserver
      SQLServerResultSet.next
      1. com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
      2. com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer.nextRow(SQLServerResultSet.java:4853)
      3. com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLServerResultSet.java:1781)
      4. com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:1034)
      4 frames
    3. Hibernate
      QueryImpl.list
      1. org.hibernate.loader.Loader.processResultSet(Loader.java:946)
      2. org.hibernate.loader.Loader.doQuery(Loader.java:917)
      3. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:348)
      4. org.hibernate.loader.Loader.doList(Loader.java:2550)
      5. org.hibernate.loader.Loader.doList(Loader.java:2536)
      6. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2366)
      7. org.hibernate.loader.Loader.list(Loader.java:2361)
      8. org.hibernate.hql.internal.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:942)
      9. org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:198)
      10. org.hibernate.internal.SessionImpl.list(SessionImpl.java:1194)
      11. org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
      11 frames
    4. org.hibernate.test
      FooBarTest.testCollectionsInSelect
      1. org.hibernate.test.legacy.FooBarTest.testCollectionsInSelect(FooBarTest.java:99)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:483)
      4 frames
    6. JUnit
      FrameworkMethod.invokeExplosively
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      3 frames
    7. A Hibernate O/RM Module
      ExtendedFrameworkMethod.invokeExplosively
      1. org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
      1 frame
    8. JUnit
      FailOnTimeout$StatementThread.run
      1. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      2. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      3. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
      4. org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)
      4 frames