- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Is see no WTF here.
Online table schema update - OK Run query - OK
Having paranoid network admins with crazy firewall rules - NOT SO OK
Admin
Oh, the sensible comment (before my "Frist At Last!" one that has now been deleted!!) was that anyone attempting dynamic DDL in a function/procedure/package/whatever probably deserves all the performance woes heading their way.
(Says the man who inherited code which drops and creates entire tables by the bucketload for no discernable reason... OK, the reason was: a developer I wouldn't these days let within 100 yards of any database under my control. Just so happened he was my boss at the time...)
Admin
uh... ping much?
Admin
Being able to run alter/update queries against a database does not mean that the database is running. Oh wait, yes it does.
Admin
WTF? WTWTF? And what did this have to do with passwords?
Admin
You'd think the fact that you managed to connect to the RDBMS on the mainframe might be enough of a clue that it was running.
Although, assuming you're using an established connection, it possibly won't actually notice the drop until you try and do something else. I'd just do something along the lines of "SELECT 1 FROM DUAL;" to get around that though.
Admin
I wouldn't call it a major wtf, but altering a table on the mainframe to check the connection status is a tad extreme!
Admin
Is TRWTF here the use of a try catch in such a manner?
Admin
Umm for all the people who just commented...
Being able to connect to a database does not mean the MAINFRAME is up, they are likely two different systems. Perhaps the mainframe updates the column in the database to tell it "i'm up!" every so often.
Altering a table to add a column via DDL in production application code is just stupid. That is what release scripts are for.. This code is getting run over and over, whenever someone tries to log in, and throwing an exception when it doesn't work! Schema's don't change every day... update it once and forget about it.
Captcha: tego .... aren't those the stickers for cell phones?
Admin
I've actually seen a case where the database server was up and running and actually answered to queries to check whether it was working (simple calculations). When any data was requested the database server hung though.
Can't remember what was done to fix that (could have been service restart).
Admin
The Real WTF (tm) is that no one is catching WOODEN_TABLE_NOT_FOUND.
Admin
Is mainframe up?
Database != Mainframe. Mainframes MAY run databases but do not imply any relation....?? I'm so confused.
Admin
Admin
I can ping in Win7 without having to run as admin, and .NET also has a class to ping without needing admin access.
Admin
ALTER TABLE [Comment] ADD frist bit, first bit, fist bit
UPDATE [Comment] SET frist = 1...tbc
Admin
TRWTF is everyone who commented to say they don't see a WTF in this code.
Captcha - transverbero. WTF?
Admin
which is why you have /sbin/ping suid root. oh wait, its basic, so its probably not an unix box... oh wait, that also explains the login slowness... where's the WTF, is the general dumbness of not using a proper OS?
Admin
Admin
Why would a mainframe -- a type of computer designed with reliability and availability as driving factors, and the price tag to prove it -- ever, EVER not be online?
Admin
Admin
Somebody unplugs a router/switch ? Power surge fries NIC? Come on, there are a million things that could make a mainframe unavailable to a particular app. Are you serious?
Admin
I don't know if it's a wtf, but it's pretty dumb.
Admin
You do realise that FTW is WTF backwards...
Admin
System.Net.NetworkInformation.Ping... Found by googling ".NET ping", 3rd hit...
Admin
Of course, for a real heartbeat you need more than ping. It's better to use a service that's hosted inside the same connection infrastructure (software server, physical server, etc.) as the real service that you're keeping an eye on. Why? Because it's quite possible to have a machine that responds to ping without a working userland, or a working userland but no software service container, or a service container but no service instance, or… I've seen all of these happen for real. The closer you put the heartbeat to the thing that you're really monitoring, the better. (Only idiots and network admins rely on ping for monitoring, and netadmins should know what it is actually doing.)
Admin
Uhhh, 'cuz the cleaners need that electrical socket to polish the floors on Fridays at 1745?
Admin
The issue is not whether the mainframe is on. It probably is 24x7 and extra on Daylight Savings day shift.
The issue is whether particular applications on the mainframe are running and accepting inputs. (They may be running, but in maintenance mode, so users have to wait for them to re-open).
Whether a test of changing a table is the best way to decide that, is a interesting question. My best guess would be no, but then I do not have access to the change log that shows the previous attempts to solve the issue.
Admin
Nothing mentioned there about access restrictions. ???
I have used every version of windows since 3.0 as well as most flavors of Unix/Linux. I have NEVER seen a restriction on using ping. Ever. What have you been smoking?
Sure, if you tried to do it thru raw sockets, then you would have a problem. That's why MS supplies the icmp.dll library. I've used it many times. No admin access required.
Admin
I am fresh from college and our network ignores ICMP pakets, all of them!
Admin
The Real WTFs are 'application used Alex R.'s company isn't exactly bad' and 'deveoper'.
Admin
I would be fascinated to see what the application does if the mainframe is not online. I bet it just brings up a message stating "System Unavailable"!
Admin
On the other hand, there are so many handy and timesaving features more than a quarter century old now that GUIs still haven't figured out how to implement* that I guess all you can celebrate are the pathetic gains of the latest minor tweak.
Admin
So why was there a pause at login again? Because of a query against the database?
Admin
Finally found the WTF, you're using Microsoft as your reference for how a standard should work?
Admin
Admin
It's like a drunken Yoda this article wrote.
Captcha: validus... Darth Validus.
Admin
In that case, your comment is not applicable since, from the logical view of an app, a ping is a ping. For the app, whether it is a true ICMP request or a non-admin ping is irrelevant. Non sequitur.
Focusing on the need (justified or not) to exec something that acts like a ping, I've never seen such a restriction (unless a sysadmin explicitly chmod 744 on ping.) Been working with NT/XP, Solaris, HP, AIX, several specimens the Linux bestiary, for almost 15 years, and I've never seen a intrinsic restriction of an app not running as root spawning/forking a ping.
In general, nothing prevents an app on windows from spawning a shell command running ping. And in *nix platforms, applications run under specific users that might belong to groups. I can give any of these groups access to ping if I need to.
On another note, even testing if a mainframe (or whatever) is up via ping is usually a brainf1rt.
Instead of testing for physical server availability, you check for service availability. If it runs on somehost, and if it runs on TCP on port 1234, you simply attempt to establish a telnet connection to that port (or a TCP connection pro grammatically from within the application). If the service is up, you'll get the telnet connection (or tcp connection). You can't do anything with it since the service is not really telnet, but that's beyond the point. You got the connection - proof that it is up.
Admin
First... Instead of trying to add a column and see if it would fail, you can check if it exists and add it if not.
Second... If you set the default to 1, you can skip the initial setting of the column value.
Third... Why th ehell has the user connecting to teh database the rights to change the schema?
Last... Exit try, empty try catch boxes, no try catch on the last statement... ARGH!
(hehe CAPTCHA: damn um )
Admin
Admin
Admin
QFT.
"Those who don't understand UNIX are condemned to reinvent it, poorly." – Henry Spencer
Q.E.D. Microsoft Windows
Admin
I can guarantee you they won't ignore the RCMP though!
Admin
I'll summarize. There are two systems. A database and a mainframe. When the users try logging into the mainframe, a script checks the database to see if the mainframe is currently available. It is this "check" shown in the code, that creates the pause.
The idea of checking a database, to see if a mainframe is available, is questionable. There were a couple other reasons mentioned, but if your database server goes down, you probably just blocked the front door to your mainframe also (based on the level of forethought by the developer).
The way that they are checking the database is certainly a WTF. You have some serious issues if you need to check that a column exists in a table before you query the column. And the way they check is just silly (by adding the damn column and erroring if it already exists).
Admin
As soon as you get a little experience, it will start responding to them.
Admin
Pong>Ping
Admin
There are three (I'm open to alternatives) descendents of Multics.
One of them was VMS. We'll deal with that later.
The second was Stratus VOS. I'd argue that VOS was the ultimate Multics ... but it was tied to the hardware, and couldn't compete.
The third, and most pitiful, was Unix. Oh, joy! Suddenly, an operating system that makes PDP-7/9/11s look useful!
Sadly, or not -- and it's a shame to have to give up on 1970s OSes -- nobody in their right mind would listen to Henry. Linux, for example, is Unix reinvented poorly. Tubularly poorly.
VOS was a damn good shot. VMS is now (buggered up as) Windows, and it just about makes the grade. OSX is a decent facade in front of a decent BSD implementation.
Other than that: Spencer is talking out of his arse.
Time for a CAP micro-kernel, I think. And bollocks to Posix compliance.illum
Admin
I think the people that thought the database was on the mainframe are wrong. The database has the status of the mainfrme in it. The first time it tries to check the status, the table is altered,and the table is updated to say if the databse is up or not. It appears that the code:
If _Settings.GetSetting("General", "MainframeOn", False) Then t = "1"
indicates the state of the mainframe, as this is used to update the table.
After the first time, the table will just be queried. But the table is not correct is it? why not just execute that line of code related to GetSetting?
That's The real WTF isn't it?
Admin
Who runs code...prior to any login...with ALTER DB permissions?
Admin
Admin
Ping doesn't cut it if what you care about encompasses more than just the network subsystem. You can lose your database without losing the server.