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

Coldfusion to Azure sql, Connection retry logic implementations?

New Here ,
Jan 08, 2021 Jan 08, 2021

Copy link to clipboard

Copied

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!

Views

175

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

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
Documentation