From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database toolkit - retry mechanism?

Hello gurus,

The following is part of a database read/write design aspect, and hope that you're able to help me find solutions 🙂  I have a couple of my own, but would like to see what others may come up with.

 

Details:

I have been able to successfully use DB toolkit  vi's to read/write to an SQL database. Everything works as per the design -mostly- . The last piece I have yet to implement is the "retry-mechanism": what if during the WRITE action my database happens to be unavailable? do I save the data to a flat file and upon "reconneciton" I flush the records? this sounds quite simple, doesn't it?

 

This is the piece I'm trying to figure out. If you've done something like this already, would you please share your approach?

 

In advance, thank you.

 

0 Kudos
Message 1 of 2
(2,500 Views)

Are you talking about a temporary, as in seconds or minutes, down time or are you referring to a busted router or mother nature incident that may involve hours of downtime? 

 

For the extended periods of downtime, I wrote in an option that i can switch my app to a "Standalone" mode so that it will write to a local mySQL dB.  After the downtime is over, I click a button and it syncs the data over to the server dB.  I thought about writing my SQL statements to a text file in that situation so that i can flush them at one time to the server but for some reason (which i can't remember right now), I chose not to do that.  I use a lot of stored procedures and it's fairly simple to keep those updated in MSSQL and mySQL.

 

For the short periods of downtime where maybe the wireless connection flakes out for a second, I use the Specific Error Handler library (found on VIPM) that can be configured to retry any number of times when a SPECIFIC (get it - "specific error handler") error occurs.  If unsuccessful, an error is reported and the app goes into lock down mode until it can successfully ping the server.  Works great for my situation.

 

Capture.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 2
(2,477 Views)