Wednesday, January 6th, 2010

afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
I've spent the afternoon tracing a legacy data issue, which was preventing any changes on older records from being saved. It turns out that having a null value for an optlock in the database, causes a org.hibernate.StaleObjectStateException; I also saw javax.persistence.EntityNotFoundException in the logs.

Funny, this is the reverse of what most other people have run into -- most other people getting the EntityNotFoundException were doing so because they had an invalid id, and the fix for them was to make their id NULL.

In hindsight, it was to be expected. Would it be better behavior to instead handle this case more gracefully (treat null as a 0, instead of an exception)? I can't make up my mind. It would have made things easier for me, but it does seem rather an edge case, made possible only because we'd migrated old data into the system.
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
00:04:37 — I keep trying to use the word "egregious"
13:34:13 — Hehe, women are getting green urinals: http://bit.ly/7Xf0wj (better than the pink ones for men!)
13:36:00 — RT @godiane: 1st North Luzon FOSS conference http://bit.ly/7h8nTw
13:47:56 — @iruka11 it's fully enclosed, so it's all good :D
15:15:15 — working with unicode in perl: http://bit.ly/8Qxa7H
19:34:51 — ah. facebook and privacy: http://bit.ly/5JXQVY
20:12:53 — Am at Secret Recipe trying out their carrot and ginger soup. Exactly what I needed!

Total: 7 tweets

You can find me as afuna on Twitter.