The Exception thrown to the application regarding Hibernate included in JBoss EAP 7 differs between SQLServer2005Dialect and SQLServerDialect.
Issue
-
When the following
SQLServerExceptionoccurs in MS SQLServer's JDBC Driver, Hibernate'sSQLServer2005Dialectthrowsorg.hibernate.exception.LockTimeoutExceptionto an application, but Hibernate'sSQLServerDialectthrowsorg.hibernate.exception.SQLGrammarException.Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Lock request time out period exceeded. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262) at com.microsoft.sqlserver.jdbc.SQLServerResultSet$FetchBuffer.nextRow(SQLServerResultSet.java:5415) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.fetchBufferNext(SQLServerResultSet.java:1758) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(SQLServerResultSet.java:1016) at org.jboss.jca.adapters.jdbc.WrappedResultSet.next(WrappedResultSet.java:2689) ...snip...(The above
Lock request time out period exceedederror occurs when MS SQL Server returnsEvent ID 1222. See the details is here(MSSQLSERVER_1222).) - So an application gets a different Exception from Hibernate between using
SQLServer2005Dialectand usingSQLServerDialect.- SQLServer2005Dialect => org.hibernate.exception.LockTimeoutException
- SQLServerDialect => org.hibernate.exception.SQLGrammarException
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 7.4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.