Tuesday, August 29, 2006

NHibernate and ORA-12571 Errors

I've been attempting to apply my Hibernate knowledge to some new C# development that I've been doing with NHibernate, and came into a bit of a crazy situation.

When I was working on the mapping of the first table (to make sure that all my connection setup infrastructure was working), I came upon what seemed like a particularly pernicious bug: ORA-12571 ("TNS:packet writer failure" message string) errors were occurring constantly when I did a query using a named parameter. Googling these errors seemed to imply that there might be some type of networking problem going on, so as I don't have much access to the development Oracle instance that I was using (Oracle for the pedantic), I enlisted our Systems team.

Turns out that on the server we were seeing log messages of "ORA-00600" on the statement in question, indicating that there's corruption or an error in the format on the data being sent to Oracle by the client.

After doing some more experimentation, I came up with the actual issue, completely shrouded by all this networking gobbledigook: NLS. Or, specifically, the difference between DbType.String and DbType.AnsiString in ADO.NET.

In Hibernate, since Java only uses Unicode internally, I got quite used to just saying query.setString("Foo", val) rather than trying to actually figure out the differences between Java/JDBC and ADO.NET. Turns out that ADO.NET has a difference which flows through to NHibernate.

So, to make a long post short, if you run into ORA-12571 errors using parameters in NHibernate, it's probably not your network or machine, but check that you're using the right data binding in your query binding (e.g. query.SetAnsiString() rather than query.SetString()), because if your database is expecting a particular character encoding and you don't send it, it shows up as a network corruption message.

Tuesday, August 15, 2006

Murano Urban Resort: Don't Bother

My partner and I went to Paris to celebrate my 30th birthday recently, and while the last time we were there we stayed at the nearly (save the location) perfect Hotel Sezz, since we were there a new, and supposedly extremely chic, hotel has opened, the Murano Urban Resort. If you follow designer-trendy hotels, you've probably heard of it, since it's had a writeup in every trend-victim bible since it's opened. Here's my writeup on it:

  • The location seems somewhat convenient

    That's what I'll say about that. It's on the outskirts of the Marais and near Republique, but quite frankly, Boulevard du Temple isn't the most scenic of Parisian locations, so unless you really want to be near Republique or the Marais, there isn't a whole heck of a lot about the hotel to like. But enough of my positivity, let's go straight into the complaining!

  • The Rooms are Cheap

    Something that they don't show you in all the pictures of the place are that almost everything you see is made of plastic. Cheap plastic. Ikea-grade plastic. The bathrooms are almost half-done (like they ran out of black slate in the budget, so they just didn't go to the point of making sure that the rooms looked nice, they just stopped putting it up half-way up the walls), and not finished very well. It really looks like they blew the entire room-decoration budget on the fingerprint scanners (which don't really work), the mood lighting (all shades of pink), the B&O television/remote control (with nothing on you might want to watch in English), and the ashtrays (ironic given that ours was a non-smoking room in a non-smoking floor), and just had to make do with the rest.

    And yet the rooms are really expensive. For all that you're paying about EUR 350/night. Without a view.

  • They've Joined the Cult of Dark Public Spaces

    I don't know what it is about design-victim hotels, but so many of them seem to have come to the conclusion that if dark is sexy, than pitch back must be sexier. Thus, much like the Sanderson in London, all hallways and public spaces are pitch black at the Hotel Murano Urban Resort. For example, if you get into the elevator, it's so dark that you can't actually see the buttons, which are not illuminated in any way. When you get to your floor, the hallway is so dark that I actually bumped into a wall, not realizing that the black-painted wall had a bend in it.

    To really mess with their guests, they've made sure that the central area of the bar/lounge (the one with the white sofa and the fireplace that's in all the puff-piece photos of the place) has a massive skylight, meaning that this white space is bathed with light. The hallway leading into there from the residences is pitch black (as are the upstairs hallways and the elevator). What happens when you walk into it? You're blinded. Painfully, painfully blinded. Thanks, designer! Way to think ahead!

  • The Bar is Really Expensive

    You see pictures of the bar everywhere. Fair enough. But EUR 20 for a beer? Surrounded by other patrons who look down on you? And the staff who looks down on you even more (as though to say "how stupid are you to be drinking here?")? Is that a joke? Apparently not.

    And before I hear any of this "you just weren't cool enough," we were all dressed just as victimy and expensively as everybody else, it just seems that the bar exuded snobbery.

  • Rooms Past The Bar

    In order to get to your cheap-finished, insanely-expensive room, you have to walk through the bar. Which means you have to run the gauntlet of the bouncer looking down on you thinking "who do you think you are coming to this bar?" just to say "I'm staying here" and go to your room. Which is part of the reason why I won't ever stay at a hotel in Vegas where you have to walk through the casino to get to your room.

  • They locked us out

    At midnight (yea, we have reached the epitome of old age: at midnight on my birthday, all we really wanted was bed), we returned to the hotel room attempting to get in and go to bed. This is easier said than done, because rather than having keys of any form, they've elected to have fingerprint readers which don't really work all that well, so after both of us trying about 10 times to get into the room, I went downstairs to get the porter to let us into our room.

    This was when I basically hit the roof. Turns out that when Todd checked in, he put down a debit card for the deposit, and rather than getting authorization then, they just took the details to get authorization later. When they later tried to get authorization, Todd wasn't there, and they did a security check, and so there was a hold on the card until they could contact Todd. What did the staff at the Murano Urban Resort decide to do? They decided to remotely lock us out of the room, so that we'd be forced to come to reception to clear this up.

    The following morning when Todd complained, they did actually apologize and point out that this was not standard policy, and they made it up with a bottle of insanely cheap rose wine left in our room that evening, but quite frankly, the fact that they would neglect to do the card authorization when the customer was there, and then immediately lock us out of the room to ensure our compliance is so off-the-charts that I actually had to laugh at what poor service that is.

So if you're thinking of staying at the Hotel Murano Urban Resort in paris, don't bother. By the time you get there everything (already looking dated when we were there 3 weeks ago) will be looking even more dated and dirty and tired than it already was, they'll treat you like crap, and overcharge you for the privilege of staying there. Trust me, stay at the Sezz instead.