2

What happens when the Azure Sql server dtu exceed the limit?

I am facing the below issue, not sure if this is due to high DTU usage?

I have a spring batch application that uses Azure SQL server, it runs without any issues and updates the Database for a most part however I am getting the following error occasionally

2021-10-04T14:29:17,685 [SimpleAsyncTaskExecutor-1] WARN  SqlExceptionHelper: SQL Error: 0, SQLState: 08S01
2021-10-04T14:29:17,685 [SimpleAsyncTaskExecutor-1] ERROR SqlExceptionHelper: SQL Server did not return a response. The connection has been closed.
2021-10-04T14:29:17,686 [SimpleAsyncTaskExecutor-1] ERROR TaskletStep: Rolling back with transaction in unknown state
2021-10-04T14:29:17,687 [SimpleAsyncTaskExecutor-1] ERROR TransactionTemplate: Application exception overridden by rollback exception
org.hibernate.exception.JDBCConnectionException: could not extract ResultSet
        at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:115

enter image description here

One Developer
  • 99
  • 5
  • 43
  • 103
  • 1
    This appears to be a transient network connectivity issue, can you recheck any firewall configs or low timeout values set. See [What happens when resource limits are reached](https://learn.microsoft.com/en-us/azure/azure-sql/database/resource-limits-logical-server#what-happens-when-resource-limits-are-reached) – KarthikBhyresh-MT Oct 18 '21 at 03:26
  • Should I increase the connection timeout settings at the Azure Sql server level? Or should it be handled in the client application? – One Developer Oct 18 '21 at 04:37
  • 1
    Server, default is 10mins, if you are seeing this error past that, this will help: see [To configure the remote query timeout option](https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-remote-query-timeout-server-configuration-option?view=sql-server-ver15#to-configure-the-remote-query-timeout-option-1) set the value of the remote query timeout option to 0 to disable the time-out. – KarthikBhyresh-MT Oct 18 '21 at 04:50
  • 1
    Can you check more in the stack trace, there should be more to the exception or error message. Please share complete for better understanding. [Confirm whether an error is caused by a connectivity issue](https://learn.microsoft.com/en-us/azure/azure-sql/database/troubleshoot-common-errors-issues#confirm-whether-an-error-is-caused-by-a-connectivity-issue) – KarthikBhyresh-MT Oct 18 '21 at 05:02
  • What is the client application, how is it configured – KarthikBhyresh-MT Oct 18 '21 at 05:12
  • Updated the question with the logs, please suggest – One Developer Oct 18 '21 at 05:25
  • checking.. can you share your connection url – KarthikBhyresh-MT Oct 18 '21 at 06:00

1 Answers1

1

This appears to be more of a spring and hibernate related implementation error than an issue with SQL. A rollback seems to be unsuccessful, there can be uncaught exceptions over which spring attempting to rollback, however, usually it doesn't rollback for unchecked exceptions. This is when that transaction might just timeout! Hibernate tries to rollback transaction but spring doesn't cause it cannot find an exception and continues with commit but commit fails cause Hibernate marked this transaction for only rollback.

Recheck for JDBC - jar version mismatch, else you need to have an exception handler to fix this. Use an attributes of @Transactional annotation to prevent from rolling back. checkout Interactions Between Batching and Transaction Propagation

I am facing the below issue, not sure if this is due to high DTU usage?

if this was related to resource limitations, you would see the exceptions meassage clearly indicating the same Resource governance errors You can check for DTU quota from sql server settings.

KarthikBhyresh-MT
  • 4,560
  • 2
  • 5
  • 12