Thursday, February 05, 2009

How to get Hibernate parameter bindings and ONLY parameter bindings

Let me preface this by saying that Hibernate is a gimpy pile of steaming mule shit.

With that out of the way, if you search around with Google and look for information on how to get the parameter bindings for SQL statements executed by Hibernate (which brilliantly are not given if you turn on SQL logging; see also: "mule shit"), you'll see a lot of smartass answers like setting org.hibernate.types=debug in your log4j configuration.

While that configuration change does include the parameter bindings, it also includes a giant shit-pile (mule) of extra data that you probably couldn't possibly care less about, including every time Hibernate binds a return value to a type. These different messages cannot be immediately differentiated by severity or by type (see also: "gimpy").

There is a mostly-workable solution, provided Hibernate has implemented/continues to implement their debugging messages in a consistent fashion:
    <appender name="SQLparams" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<param name="Threshold" value="TRACE"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] - %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.StringMatchFilter">
<param name="StringToMatch" value=" to parameter: " />
<param name="AcceptOnMatch" value="true" />
</filter>
<filter class="org.apache.log4j.varia.DenyAllFilter" />
</appender>

<category name="org.hibernate.type">
<priority value="TRACE"/>
<appender-ref ref="SQLparams" />
</category>



This filters the log4j output of org.hibernate.type.*, including only the lines that contain the text " to parameter: ". This will of course also include constants coming back from your database that include the phrase " to parameter: ", but chances are this will usually be good enough, unless or until Hibernate pries its overinflated head out of its ass.

Labels: , , ,


Thursday, July 31, 2008

Mind-Boggling Idiocy

Last week I ordered a monitor. A Dell 2408WFP. I have one at work, and I know it to be a great monitor, so I wanted to get one for home as well. For work, it took roughly 3 days from the time I ordered it until the time it was delivered to my cubicle.

I placed the order with Dell last week, but today it looked like it was seriously stuck in the "in production" phase. What's there to 'produce' anyway? It's just a monitor. There's no customization needed. It just needs to go in a box. So I submitted a web request with Dell Customer Service, which included my name, customer number, order number, home address and so-on. I jokingly asked, "is it being assembled one pixel at a time?"

I got back an automated response telling me that the industry standard for stuck or dead pixels is 5 per screen, and that if I had that many or fewer, I'd just have to live with it. Or if that didn't answer my question, I could reply. I made the mistake of replying.

I say 'mistake' because Dell has outsourced customer service to semi-sentient balls of yarn in India, and what happened next was a colossal waste of my time. The one saving grace is that from a certain perspective, it is a funny waste of my time, especially when the conversation is condensed and all the email headers removed. I shall present the conversation to you now, replacing the Dell representative's name with the word "yarn."

Me: I didn't ask about stuck/dead pixels. I asked why it's taking so long to process my order for a non-customized piece of equipment.

Yarn: To protect your data privacy, we require a Dell identification number. This can be found on any communication you have received regarding this order. A Dell identification number can be an order number, customer number, service tag number, express service code number, case number, or DPS number. In order to resolve your concern I would request you to provide the name on the account as it appears on the original order documents. Please get back in touch with us once you have located this information and we will be glad to assist you.

Me: My name, customer number, order number and address are already in this email if only you would look. What more do you need?

Yarn: In order to resolve your concern I would request you to provide the complete name on the account as it appears on the original order documents.

Me: It's the same name that it's been in all of my emails: Nicklas Johnson.

Yarn: Your order number ######### is currently in production and has an estimated delivery date of 8/8/2008-8/12/2008. You can track the status of your order online by visiting
http://support.dell.com/support/order/status.aspx?c=us&l=en&s=gen&~ck=pn
and entering your order number ######### and customer number ########.

Me: Yes, I already knew all of that. My question is: why is it stuck in the "in production" state for such a long time? It's been "in production" for almost a week. There's nothing to "produce" since the only thing in the order is a monitor. What takes so long?

Yarn: It is just an estimated delivery date, however, the order might be delivered to you before that also. Orders can be delayed for a variety of reasons.

Me: I appreciate that orders can be delayed for a variety of reasons. My question is, what is delaying MY order?

Yarn: Orders can be delayed for a variety of reasons. Please be informed that we will not be able to specify any particular reason.

Me: Who can?

Yarn: Orders can be delayed for a variety of reasons. Please be informed that we will not be able to specify any particular reason.

Me: You already said that. I asked "who can?" As in, "who can read my email and give me a constructive response that addresses my initial question?" or "who can tell me why it is taking such a large amount of time to fulfill a simple order for one item that requires absolutely no customization of any kind?" Who can investigate further and explain why this order is stuck? How do I contact that person or persons?

Yarn: I apologize you are experiencing this delay. Dell is making every effort to ship your order as soon as possible. The most current information we have is that your order number ######### should ship on or before the Estimated Delivery Date of 8/8/2008-8/12/2008.

(It is at this point that I gave up.)

Hey, Dell: you guys are assholes.

Labels: , , ,


Wednesday, April 25, 2007

LOL @ AFA

AngrySkul puts it all in perspective.

Labels: ,


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]