Archive for November, 2004

The bug in Hibernate that I reported yesterday turned out to be a bug in my Interceptor. To get to this conclusion, we did a bit more tracing through the code and managed to put together a minimal failing test (see the forum posting). I had read the Interceptor docs several months back when we implemented the first features we needed. Max from the Hibernate team reminded me of this requirement:

* The Session may not be invoked from a callback (nor may a callback cause a collection or proxy to
* be lazily initialized).

Oops. You’ll see in my test that my Interceptor is indeed causing a lazy collection to be initialized. The workaround I suggested, which involved deleting a couple lines of code, does actually solve this problem. It is, however, unclear what other problem might be caused by that change.

So, what’s the solution? For the case that I was dealing with today, it was simple to just not touch the Collections at all. There are other possible places that the Interceptor could cause a lazily loaded Collection to be initialized. My general strategy is this: use Hibernate.isInitialized to check it’s status. If it’s not initialized and I really need to use it, I’ll load the object up in a different Session.

Comments No Comments »

Today, I finally had time to spend a couple good, solid hours in the debugger, during which time I came to the conclusion that the problem my code was having was not in my own code. Sure, the exception was actually happening in an org.hibernate class, but what are the odds of encountering an honest to goodness Hibernate bug? Looks like I did find one, though: Hibernate Forums - View topic - NullPointerException - Set in Collection not initialized

From my forum posting, here are the steps that trigger this:

1) create a class with a lazy collection
2) Load up an entity of that class
3) do whatever you want, but don’t touch that lazy collection
4) flush the session
5) try to access that lazy collection

Hibernate is a great tool, and I’m very thankful that it’s open source. While I’m not averse to paying for good software, I wouldn’t want a library that does not include source. If I had to report this problem to a vendor and wait for them to a) agree that it’s a problem, b) fix it, c) release the fix, I’d be hurting. In this case, it was really easy to get the Hibernate source running in Eclipse, learn a bit about how collection initialization works, and find a seemingly reasonable place for a fix.
Update: This is not a Hibernate bug. It’s a mistake in my Interceptor code. Film at 11.

Comments No Comments »

Hilarious! communication skills - zefrank via boing boing.

Comments No Comments »

It may not be Open Source(tm), but you can now get both source and binaries for J2SE 6.0/Mustang. This being build 12, I don’t gather that it does much more than J2SE 5.0. Release early, release often seems to apply to Sun now.

Comments No Comments »

So sayeth the great fortune cookie. Possibly apropos, given that I’m starting a new business. But, who doesn’t have plans that the can keep secret for now? Besides, I want to blog the business building as it progresses. Helps keep me from forgetting things that might be interesting, if not useful, to remember later.

Comments No Comments »

Neat idea: the Koders - Source Code Search Engine lets you search for code with keywords, language and license. Reportedly, they’ve got 125 million lines of code you can search. Nifty thing about this is that I’d imagine it’s all automated. People have written neural net code to automatically identify programming languages, and they can just grab the license off the top of the code. To be sure, Google has worked pretty well for me, but this engine is quite targeted and worth a shot when I’m looking for something specific.

Comments No Comments »

I’ve decided to take the plunge into self-employment once again! This is a big step, given that I have a 1 year-old child this time around. But, as anyone who has a kid knows, there’s just not enough time to run a business part-time when you have a young child. I wish my new product was a Day Extender for Parents. That would undoubtedly be a hugely popular product.

Also, as Steve Pavlina says, there’s no better way to spur yourself to action unless you really have your skin in the game and take it full-time.

I started my last business just over 5 years ago, back in the dotcom heyday. I spent silly amounts of time honing my business plan and talking to money folk, when I could have spent more time working on my product. That’s a mistake I’m not going to make this time around. I’ve got down to earth initial goals and a plan to meet those goals.

One nice offshoot of starting my own business is that I’m free to blog as much as I want about my work. When you’re playing by someone else’s rules, you always need to be careful. I’m pretty sure that I won’t fire myself for blogging, so expect this space to become its most interesting yet. This blog is not going to become the official spokes-channel of my new business, though. You’ll still see an assortment of politics, music, movies, parenting etc. talked about here. The company website will have the “official” source of info. This will be a good place to find largely accurate rumors, though :)
Soon, I’ll have to start firing up the “new company building machine”… need to come up with names for the product and company, have to create the entity (probably an LLC), register domain names, and on and on. (First rule of running your own software shop: don’t plan on spending near 100% of your time programming. That’s not the path to success.)

Comments No Comments »

When a GUI toolkit is more than your program needs, but you want to be able to do something compact and cross-platform, check out Jimmy’s Python Pages for EasyDialogs. EasyDialogs comes with MacPython, and Jimmy has a compatible version for Windows. Very, very easy.

Comments No Comments »

It was inevitable, and it probably happened in 2000 as well: conspiracy theories that the election was stolen. “Too many voting ‘irregularities’ to be coincidence” appears to wrap a bunch of theories into one handy post. This post has bad information presentation: the graphs presented don’t go down to a zero baseline, thus exaggerating the effect that the author wants to portray. There’s incomplete information: just a few states are presented, possibly a cherry-picked set to illustrate his point. Sources cited are often just other random blogs, which don’t necessarily have accurate data. There are a couple of exceptions to that, which I’ll get to. And, finally, some statements just seem wacky. The author draws the conclusion that Kerry decided to play dead and concede because the whole election was rigged.

I do not believe that John Kerry was tossed up there as a phony candidate. I do believe in the possibility that the election was stolen, though. It was a close race, so I can imagine that people would be tempted to push it in their desired direction. If Kerry had been polling much farther ahead, pulling the wool over our collective eyes (and getting away with it) would have been more difficult.

Many people out there, including Bill Clinton, are telling people to get on with it and move on. I don’t think that’s the right thing to do, if there was genuine fraud. Rigging an election is tantamount to treason. It undermines the democratic component of our republic.

If it was truly the will of the electorate that Bush remain our President, that’s okay. Not what I’d ideally like, but that’s at least what we voted for. But what if there was tampering, and Bush was not truly reelected?

Greg Palast says that Kerry actually would have won in Ohio, had the “discarded” and provisional ballots all been counted. Kerry was down 136,000 votes in Ohio. Palast argues that a majority of these ballots were likely to have been cast by minorities who would likely have voted for Kerry. He surmises that the Democrats didn’t want a repeat of 2000’s debacle, which would likely make the party look like whining losers. That’s certainly a lot more plausible than Kerry being a ruse of a candidate. However, it’s a shame for a quarter of a million American citizens to be deprived of their basic right to vote.

Others have noted irregularities in Florida. In general, you would expect voters registered with a certain party to vote for that party, minus some portion that jumped the other way. I’m actually a registered Republican, so I’m an example of that. But, you wouldn’t expect the jumpers to form a large majority of the voters from that party. In Florida, and only on the optical scanning machines, there were a number of counties where you see things like 77% registered dems, but a 77% tally for Bush. This is especially intriguing because of the tie to a specific technology. The situation in Ohio seems more a matter of counting peculiarities and an unwillingness to go the distance on the part of the Republican Secretary of State. In Florida, it sounds much more like a hack.

This type of thing during the election and the electioneering done via redistricting in Texas are the way to killing our country. People who voted for Bush have every right to be pleased that their candidate won. But, we all need to be careful… some day, you might not want a Republican candidate, but you might not have any choice.

Comments 3 Comments »

Contrary to the post about IQs and voting, I’ll go ahead and post a link to ps. i’ll find my frog. All it needs is a music video with a catchy techno tune. All your frog are belong to us.

Comments No Comments »