Failing Quickly in ASP when your database is missing.
Frustrated with ASP’s stubborn refusal to honor the ado.connection’s .connectiontimeout setting for an oledb connection, I searched all over Google trying to find a way to shorten the amount of time ASP / ADO will look for a database that’s missing. Finally found it. Here’s the deal:
My server was taking 45 seconds for ASP (or ADO, more likely) to return the error:
Microsoft OLE DB Provider for SQL Server error ‘80004005’
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
When the database it was looking for wasn’t connected to the network. That’s 45 seconds a user sits waiting for a webpage that’s only going to show them an error. As if they’d wait 45 seconds for it.
The speedy answer turns out to be adding “Connect Timeout=n” to the Connection String. e.g.: “Provider=sqloledb;Data Source=MyServer;User Id=MyLogin;Password=MyPassword;Initial Catalog=MyDatabase;Connect Timeout=3”
If ADO can’t reach the database in 3 seconds, it quits trying and returns an error right away. With basic error handling you can recover,try another database, show a friendly error message, or skip the database-generated content that’s not available.
Now it would be *really* smart if the failure set a flag that prevented future attempts from even trying, so you’re not waiting 3 seconds per attempt. I still need to fix that part.
GMail Forwarding isn’t as reliable as GMail POP.
Twice in the last week I’ve noticed GMail forwarding isn’t as reliable as its POP3 option.
My parents were beseiged by spam, and I helped them:
- create new pop3 mailboxes with secretive names
- forward their existing addresses to new Gmail accounts (where spam filtering is fantastic)
- configure GMail to forward their received mail to the new secret pop3 accounts
- switch their Outlook mail clients to look for mail in their new pop3 accounts
A few days later they both reported that when they log in to GMail they see messages that never made it to their inbox. No amount of manual-forwarding, re-send/receiving or voodoo chanting helped.
A more reliable method of using GMail to screen out spam is to disable GMail forwarding and active GMail POP access. Now when their Outlook clients retrieve from GMail, they get everything, minus the spam. Strange but true.
No pushover.
One of my son’s first repeated, understandable words: “Move”. As in, “Get out of my way, I’m pushing on you for a reason, you moron.” Frequently spoken to me and his sister. He’s 16 months old.
Speaking of which, she’s learning this week that she can’t push her little brother over. Not because he won’t fall — he will. Not because we won’t spank her for it — we will. No, it’s mostly because when he gets back up, he’s goes after her, and he can push her down too, now. And he doesn’t announce his intentions with “move” first either. He just rams her.
In a “I should really stop my kids from doing that… in another minute” way, it’s hilarious to see.