Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Coldfusion to Azure sql, Connection retry logic implementations?

New Here ,
Jan 08, 2021 Jan 08, 2021

Hi 

Just wondering if anyone has any experience with implementing connection retry logic with Coldfusion and Azure sql, to handle transient connection failures. I have an application that is hosted on Azure with Azure SQL and there have been a few instances where the DB has failovered intermittently while a user was requesting a page, thus resulting in an error. Looking to see how I can minimize this impact and make it a seamless experience on the user's end when this occurs. I've looked at https://docs.microsoft.com/en-us/ef/ef6/fundamentals/connection-resiliency/retry-logic which is based on an EF6 library.

 

Thanks!

308
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 09, 2021 Jan 09, 2021

CF's database interaction is typically not as low-level as the code you're showing. But there's no reason why you couldn't handle connection failures at a higher level using CFTRY/CFCATCH or even higher-level error handling. If this happens a lot, there's no reason why you couldn't build a wrapper that lets you try a database connection, catch a connection failure caused by this behavior, wait briefly if needed, then retry the database connection. Presumably if you have the same problem a second time you'd want to respond with an actual error state, I guess.

 

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 09, 2021 Jan 09, 2021

2 suggestions in addition to Dave's:

  1. ensure that Maintain Connections is enabled for the datasource.
  2. use the cachedWithin attribute for queries that do not change often; ColdFusion would then use the value from cache rather than make another trip to the database.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 11, 2021 Jan 11, 2021

Thanks for the suggestions guys.. I've added what you suggested Dave to the onRequestStart method of the application.cfc so will monitor and see how it goes with handling the issues.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 17, 2025 Jul 17, 2025
LATEST

I know it's been forever since this thread was abandoned, I found it while looking for answers to a similar issue.

But once again, I find a comment in which someone has created some code for their own problem, and also decided not to share it. I'd be angry... but I'm probably guity of the same habit. ;-]


I will travel on. Who knows, perhaps my continuing search or AI results will teach me that CF or JDBC options have gotten better at leveraging Azure SQL's built-in retry logic in the past 4 years.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources