Monday, October 27, 2008

2 days I'll never get back

Through sheer happenstance, one of the test databases for our new system was (mis)configured in such a way that an Oracle sequence was generating very large ID's for a certain field.

Very large as in 123,456,789,236

Guess which horrible application uses a 'long' type to hold those IDs? Guess which horrible application is supported on both HP-UX and Windows? Guess what type might be 32bit on Windows and 64bit on HP-UX? Ding! Ding! Ding!

Spent all day Friday and today rejiggering the code to use 'long long'. Most of today was spent un-rejiggering and re-rejiggering the code to work around Oracle Pro*C's inability to use 'long long' as a host variable -- today I had to swap all that out of the embedded SQL in order to use character strings and stroll/sprintf to move values from the strings to 'long long' and vice-versa.

I had thought the code was 'OK' on HP-UX... after all these recent changes, I'm not so sure. The code to transfer the values from the query results to their 'long' variable instances seems wrong. In any case... it'll work the same on both platforms now.

I take some solace from finding the problem before any customer. We have at least 3 customers nearing 1-billion bills -- although the horrible app is 10+ years old, the rate they're adding bills to their systems grows every year. They can also start/change their sequences whenever they feel like it. So, maybe we had another 1-5 years before it became a major emergency.

3 comments:

Bartski said...

You're a superstar.


What more can anyone say?

neeber said...

I hadn't realized someone could take what I'd meant as "Lookit my horrible project!" to be "Lookit my awesomeness".

Not all posts can lame book reviews, or odd things what I stick in my food-hole. The rest are whining / ranting about my job.

I can't decide why I'm still putting up with the horrible. Partly, it's due to the economy. Partly, it's due to stubbornness and not wanting to let it beat me into submission. "Ha! I'll show you stupid job, I'll let you destroy my love of programming!" It's a good plan.

Bartski said...

Ah, c'mon, the whole "long long" thing was a stroke of genius. You know you were just bragging (well, bragging and admittedly whining at the same time).

And how does one "lame" a book review? I didn't even know lame could be used as a verb. See, I learn something new from you every day.

Oh, sweet irony - my captcha word is "trole." How appropriate.