If you run Liberty, you’ve likely seen Connection Failures more than once. More-so, you’ve likely been hit with this either in the middle of the day, or come in to the store in the morning to hear the dong, dong, dong, dong and see the cascading errors covering your screen:
What Does A Liberty Connection Failure Mean?
Liberty utilizes MS SQL Server to store and retrieve your data — this is a good thing. MS SQL Server is its own, stand-alone program which Liberty communicates with. Just like you make a phone call to someone, Liberty makes a ‘call’ to MS SQL Server when it needs to put new stuff in to or get stuff out of the database. If it can’t get through to MS SQL Server — e.g. MS SQL Server isn’t running, your server computer is offline, your WiFi connection drops, you have both a wired + WiFi connection on your PC, etc. — it will pop-up a Connection Failure error.
Why Do These Errors Pop-up Over and Over Again?
The Connection Failure in and of itself isn’t a *bad* thing. Liberty actually properly ‘handled’ the fact that it couldn’t connect to MS SQL Server. The reason it pops-up over and over and over again, is because Liberty is using a Timer component to try and connect to the database every second. That timer is set to Tick every second, which is why when it can’t connect, you’ll see the error and hear the dong, dong, dong, dong every second. The problem at this point, is you’ve lost control of Liberty and you can’t close it. This is the first and primary issue with how Liberty handles the Connection Failure. Instead of letting the Timer Tick event tick over and over again, every 1,000 ms, it should recognize it cannot connect to the database, set the Timer to Disabled, and then provide you, the user, with a more-intuitive message and response — e.g. “Uh oh! It looks like Liberty cannot connect to your main computer running MS SQL Server. Please check your connection and make sure MS SQL Server is running. Try again?”
This issue is so prolific and creates such a delay for our clients, we’ve made our own Kill Liberty button so they can safely kill the running process:
What The Heck Is a Timer?
In software, sometimes you want to *do stuff* every X seconds/minutes — e.g. every 15 minutes, check for new updates. To do this, you can use a specific component available in most programming languages, called a Timer.
A Timer is a component you can add to your program and then set it to ‘tick’ on a regular interval. The default interval is typically 100ms, so to make it tick every second, you’d set it to 1,000 ms (one thousand milliseconds = one second).
Great, now it’s ‘ticking’, but what is it actually going to do when it ticks? In Liberty’s case, it tries to connect to the database every second. When it can’t connect, it pops-up an error letting you it can’t connect, then it ticks again, then it pops-up, then it ticks again, and so on.
That it knew it couldn’t connect to the database, means it properly handled (responded-to) the exception (unexpected event/situation) it encountered. When an exception is handled, the programmer has a choice of what to do. At the very least, it’s typically best to inform the user of the issue with a pop-up message. You can take this one step further though and add additional things to do when an exception is handled. One of those things, in this situation, would be to stop the Timer.
This way, it doesn’t keep ticking over and over again, thus, preventing the non-stop pop-ups and providing you with a way to either ‘try again’ or close the program altogether.
This is an old, old issue in Liberty and I shouldn’t have to point this out to the vendor in order to improve Liberty users’ experiences. My goal though, is to make my clients’ lives easier and this single issue, is one of the most common and difficult to handle issues for our clients. If The Computer Peeps have to be the ones to bring attention to issues and get them fixed, then so be it.
This issue has been reported to the vendor on multiple occasions and there’s no way they’re not fully aware of this issue. Which raises the questions — Why has Liberty been allowed to do this for over a decade? Why hasn’t this been fixed? Why does it take The Computer Peeps to shed light on these issues? Why isn’t the support staff and developers @ RSW finding and fixing issues like this without prompting?