2

I have a staging SQL database in Azure and I use the mssql node module to connect to it. The only problem I got is the idle connection policy in Azure. After 30 minutes of idleness the connection is closed automatically.

Is there anyone who faced the same problem?

1 Answer 1

2

Do you use connection pooling in your app?

Per "Connection Constraints" in Azure SQL Database General Guidelines and Limitations:

"A logged-in session that has been idle for 30 minutes will be terminated automatically. We strongly recommend that you use the connection pooling and always close the connection when you are finished using it so that the unused connection will be returned to the pool."

Sign up to request clarification or add additional context in comments.

2 Comments

I'm using an ORM third party which holds a global connection with keep-alive on. Do you think it may be the problem?
Could be. I'm not sure I understand what the problem is, since a connection is expected to close after 30 minutes of idleness (and then you'd have to re-open it). Connection pooling (implementation depends on your driver, but this is typically enabled by default) helps minimize the overhead of having to open new connections since idle connections in the pool can be reused (and then they're no longer idle, of course).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.