- 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
Surely, this could be done in Java as well, and the result stored in a real table. It would also be a far less flexible solution, and relegate your database engine to a somewhat funny-looking file system. Fine if you use MySQL or similarly limited database engines, but the 'XML in a database is bad' mantra is yet another urban myth that 'real' developers should get out of their heads.
Admin
Well, I'm disappointed. Mr P posted this so late there were no comments this morning. And so many memes that could be exploited, frist, yo dawg, etc. but somebody beat me to being the post before second so I shan't bother.
Overall, this is such a bad idea, it's not funny. I despair.
Admin
In logging, funny, I just saw a guy make a table like this, with varchar columns col1, col2, col3....ad nauseam. When asking "WTF?" he said, "well, these are placeholders, into which the users of my LOGGING TABLE can write what they want". Behold the well organized, scalable, non-corruptible architectural vision of the author. Thank God I got him to shoot it down, albeit after a LONG discussion where his argument was "there are many ways to skin a cat". I would like to skin him...
Admin
(Insert appropriate "LOG ALL THE THINGS!" meme here)
Admin
private void WriteComment(long articleID) { articleComment.GenericVariableString1 = articleId; articleComment.GenericVariableString2 = "Frist!!111"; // Not real comment, thankfully... articleComment.Funny = false; articleComment.GenericVariableString3 = String.Empty;// Future use... articleComment.GenericVariableString4 = String.Empty;// Future use... articleComment.GenericVariableString5 = String.Empty;// Future use... articleComment.GenericVariableString6 = String.Empty;// Future use... articleComment.GenericVariableString7 = String.Empty;// Future use... articleComment.GenericVariableString8 = String.Empty;// Future use... articleComment.GenericVariableString9 = String.Empty;// Future use... articleComment.post(); }
Admin
Time to ask a stupid question - Why would anyone create these "place holders"? I mean, why can't you just add new variables as you need them?
Note that I don't touch ASP, or any web/database oriented language.
Admin
We use Xml columns in SQL Server to store serialized objects, which works well except for the otherwise pretty good Entity Framework which interprets Xml columnds as strings..
Admin
Is it really a problem? Supposing you're using .net, you can just use LoadXml when you read from your column and ToString when you write to it, can't you? I did that when I had to port a db to SQL Compact, and I can't see why it would be a bad idea.
Admin
Is it just me or is there so much wrong with this apart from being copy/pasted into 200 pages?
From the static logEntry vars to the reserved vard and the comments about not getting stuff to work.
Also this; logEntry.GenericVariableString2 = "WebForm1.aspx"; // Not real page name, thankfully...
Why make an entry of if when it's of no use?
Or did I miss something?
Admin
Why is anyone using anything other than the system logger ?
Every modern OS out there comes with built-in, high performance logging facilities. Just use them !
Admin
The rest of the code isn't better either, and the large-scale duplication is just peachy…
Admin
Uhm, well, you never experienced major version release?
This is called "backward-compatibility" - and nobody loves to rewrite old software which suddenly stopped working when someone changed file format.
Admin
Are they secure enough? How do you know they didn't send sensitive data directly to Steve
Admin
Must be an Enterprise logger.
Admin
One logger to rule them all....
Admin
The only thing a logger should do is shout 'Timber!' as a warning. But I'm never sure whether to hard code his axe or make it flexible so it simply may be replaced by a chainsaw later...
Admin
Ha, ha! Classic troll! Brilliant!
It's got the, "I'm doing it so it can't be a wtf!" It's got, "Mixing display rules with data is a great idea." It's got XML! It's got, "It makes perfect sense to store structured metadata (XML) in a structured data environment (DB), after all, if structured data is good, then doubly structured data is twice as good." It's got some random reference to Java. It's got an uneducated sideways swipe at MySQL.
What do you mean, "He's serious"?
I'm really worried what they're doing with that expensive Oracle DB that it becomes a "somewhat funny-looking file system" is you don't store XML in it.
Admin
Fuckinell I wish I was a clever bugger like you to instantly be able to analyse all the aspects of a system which you've got 4 lines of description of an instantly know it's a bad design because some fucker told you once that he doesn't think it's a good idea to do this sort of stuff. You cunt.
Admin
Who logs the Über Logger?
Admin
I guest the Über logger can log itself
public void logLogEntry();
Admin
To answer a stupid question with even more stupidity - they will have place holders to do this:
WriteLog("Nagesh");
Admin
But... but... if it wasn't copied into every page, we'd need some kind of module that's referenced from every other place in the system. That's tight coupling to a God object. That's bad! So just copy and paste instead.
That way, when you want to adjust the logging for one page, you don't have to worry about side effects for other pages.
Captcha: Christmas Praesent.
Admin
Admin
Admin
True story: I got a service call to one of our customers whose minicomputer (and there was nothing mini about it) was crashing, almost every day. The computer was the size of two refrigerators side by side, with a top-of-the-line 32MB disk drive the size of a washing machine attached at one side. It sat in the midst of a high school's computer lab, helping people learn how to program in FORTRAN etc. One computer wired to 16 green-screen terminals, which, with their 80 column by 24 line display regions, were vastly inferior to the 132 column by infinity DecWriters they had replaced. But now at least you could do vi instead of ed, and the first bony fingers of the future's GUI began scratching their way up out of the earth.
Since it was a school, I was pretty sure what the problem was before I even got there. Some teacher was going "Everyone type your user ID... Now hit Return... Now type your password... Ready? ... Now hit Return" which would kick off 16 simultaneous resource-hogging login processes. Even then, people thought "slow" meant "crashed", even though the system would usually sort things out on its own after five minutes or so.
But no, the lab was well in session before the system died. And one glance at the console proved that it was, indeed, crashed, for there was the familiar maze of hexidecimal numbers splayed everywhere like digital puke. I looked up the failure code in my technician's manual (hardcopy of course... the system is down!) and it said "ERROR WHILE WRITING ERROR MESSAGE TO ERROR LOG" which, of course, was intended to be much more helpful than the uninterpreted version 0A7EF4BD.
Hmmm... error while writing... sounds kinda like a write error... to the log file, which like everything else would be on the washing-machine disk. On a hunch I checked. Yep. The disk write-protect button, a red square only slightly smaller than what you'd use to panic shutdown a nuclear plant, was engaged. It was intended to be used in a two drive system, where the immutable stuff like the OS lived on the write protected drive, while swap space and user files were on the writable drive.
But the school could only afford a one-drive system. So there was no reason why the write-protect switch should ever be used. I asked the lab assistant, a dictionary case of the untouchable nerd, complete with whining voice, mispronounced words, and coke-bottle glasses, if he had any idea why the write-protect switch was on. (His student work-study program paid him to spend 2 hours a day in the lab, but he hung out there more like 60 hours a week.)
"Oh, yes," he said proudly "I activated the safety! The system crashes almost every afternoon, and I've developed the ability to tell when it is about to happen. Usually when everyone is logged in and starts compiling their programs, the disk drive will begin shaking violently like an unbalanced washing machine on spin. When I does, I drop whatever I'm doing, run to the computer, and press the button to protect the files from corruption. Usually I barely get there in time, because it crashes just a second or two later!"
Admin
Admin
In those circumstances it's so tempting to make up something expensive and revenue-boosting for the service contractor - even if they're on a flat rate - as a recompense for being so fucking stupid. Or (if you're wearing gloves) lifting the lank, greasy fanta-top of the fucking nerd to look into his ear and announce boldly, "Blimey! I can see daylight!"
Admin
Well, I guess updates could be installed on the writable drives and extend OS functions, but a virus would probably be able to exploit that.
Admin
Oh yeah, while I think about it: this dates from about 1970 / 1980? That was when we had one green-screen and 30-odd DecWriters. Happy days.
Admin
You're storing XML in (Microsoft) SQL Server, and then using Oracle's XML functions to create a view? That sounds like one hell of a 'WTF to me. Please submit it.
Admin
Thing is, we have a lot of web services. We outsource certain bits, like the web portal front-end and the CRM system installation, and to talk to the bare-metal back-end such as telephony switches and our own custom systems, we develop SOAP web services (in Java).
Obviously, you'll want to audit, one way or another, whatever comes into and whatever goes out of each and every web service. So, you have two choices:
FWIW, I'm the same guy who wrote the ws-run application, which runs a web service using an (Java) Endpoint, instead of a servlet or J2EE engine such as Tomcat. I mentioned it a few months ago on this site.
Logging used to be part of this package, but has now been moved to its own generic framework. This uses a SOAP handler that intercepts calls, and stores the XML in a neat little object that is in turned passed to logging services. These are loaded using the ServiceLoader interface, so you can simply add a JAR file and the new logging mechanism is used automagically. The support people still have to manually set which loggers to use; whilst there is no strict requirement to do so, it makes it more flexible for them. Switching things on or off using a configuration file is easier than having to move JAR files about.
As a standard, there's the log4j logging service, which extracts each SOAP request into a tree structure and logs this using log4j. The support people like it.
So, a new logging service, this time an 'database auditing' one, was developed, and all SOAP requests get stored in the database. Sure, you could write something in Java that analyses the XML, and stores the hierarchical XML some way or other into the table-based relational database. But it would have to be done for each and every web service invocation, and as such, it would incur a performance penalty. This doesn't make sense, because an audit trail is something that you don't use very often.
By storing the XML directly, you can separate the concerns of logging the data and visualising it. You could write a tool that shows it to customer service representatives, or create the aforementioned view so it looks like a table, and gives the support people an idea of what is going on.
We, as developers at our company, are always trying to find ways to make things easier both for ourselves and for the support people, and to separate concerns.
Another aim is to use the best tools. Oracle is a seriously powerful beast (and a bugger to use most of the time, but hey), and XML processing is one of them.
Hopefully, this has elucidated you a little bit, but if you have a better idea, I'm all ears.
But do try for substance next time you touch the keyboard.
Admin
Admin
TRWTF is visual basic
Admin
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
No, we're using something similar but on a different database engine. Do I have to explain everything?
Admin
Then I got a job as lab TA at University where I learned even more. One of the students I helped regularly eventually confided in me that he was a foreign exchange student and his dad was a big shot in the Saudi oil business. They were trying desperately to computerize but couldn't find skilled people anywhere. Did I want a job paying $150,000 a year to start?
The Saudis insisted I polish my appearance. Expensive suits, etiquette coaching, even surgery for my eyes -- they paid for it all. And because I knew English and computers, the annual salary increases varied from ridiculous to obscene.
30 years later I'm the Vice President of I.T. for a multi billion dollar operation. And the laws here, for rich people, are pretty flexible. In addition to my regular harem, any time I want a new bitch for variety I just have to dream up her particulars, describe her in detail, and within a day or two she is mine -- American or Saudi, no problem. When I tire of them, I can have the good ones paid off and sent away, and the annoying ones I just have, well, "removed".
I remember you coming to the lab that day. You made me feel pretty stupid. But I was just trying to help.
So what are you doing these days? Still wiping digital puke off the consoles of baby mainframes? Or have you graduated to field-swapping Dell motherboards? I bet you went the all-American route: got married, got 2.3 kids, got a mortgage the size of an elephant and a membership at the Church of Perpetual Payments.
Post your email address; I'll arrange to send the next worn-out bitch your way. It's the least I can do. Do you have a hair color preference?
Admin
I heard you liked logging dawg, so I logged the logging of your logs for you. If you want me to log the log log logs that's cool bro.
Admin
Admin
Admin
Sounds like you work for the big red telecom giant in Canada...
Captcha: saluto - what I'd like to do to the outsourced technical support people...
Admin
That was directed at SeverityOne, btw...
captcha: veniam - Dr. Seuss logic
Admin
Admin
Har har har.
I was expecting along the lines "but my father in jail now, so send $10.000 first so we can arrange a lawyer and you will get those $150.000"
Admin
Admin
Well, I think we got this day TRWTF and can go home. Almost nothing in there is true...
Admin
He is not a nerd, he is a moron. If he were a real nerd, he would know how machine worked.
Admin
What's wrong with that? Beats storing it in a database. If you're on a *nix esp., there's a bajillion file state systems that you can pick up that really eases this sort of thing.
Admin
If you need to store structured data in a database, why not just use a document database like MongoDB or CouchDB? They're designed to store, retrieve, and manipulate data as JSON so you don't even have to write wrappers half the time. And CouchDB can basically do the hosting for you so you don't even have to write a web service.
But I guess real developers are too busy fitting square pegs into round holes to bother thinking laterally and using a better solution.
Admin
They really named their products that, or you just mocking up names from your head?
Admin
Ist storing everything on database same problema as *nix people that think everything must be a file. Some people think that all things is records and tables. If all you have is a hammer, all looks like a nail.
Admin
Yes it is, there also somthing like Voldemort and Cassandra.