Friday, December 21, 2007

Spring 2.5 Upgrade

I upgraded out platform infrastructure to Spring 2.5 this morning. It was pretty straight-forward, although I had one painful issue. For any of our tests that use Hibernate, I was getting the following error:

Caused by: org.hibernate.HibernateException: saveOrUpdate is not valid without active transaction
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:297)
at $Proxy39.saveOrUpdate(Unknown Source)


After a bit of digging, I realized we had the following Hibernate property set:

<prop key="hibernate.current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</prop>

Basically, this was preventing Spring from managing the transaction context correctly. Once I removed it, all of our tests passed. I wonder if this is the reason why we've had some problems with NOT_SUPPORTED and SUPPORTS previously. This will require some additional testing...

Thursday, December 20, 2007

Spore

I stumbled across a new PC game today entitled Spore. It's not GA yet, but it looks extremely interesting. It looks like Civilization meets The Sims. Spore was created by Will Wright, the creator of The Sims. Here's the video I watched. You start as a single-celled organism and you evolve your species all the way up to an advanced spaced-based civilization.

Saturday, December 15, 2007

Desktop Matters (TSE Day 4)

In the second session of the morning, I decided to attend the talk entitled Desktop Matters by Jim Moore. I didn't learn much in this presentation. He walked through the history of computers from a UI perpsective: mainframe to client server to web. He then went into UI technologies that are available today to build rich applications: Flex, Apollo, Silverlight, GWT, WebStart, etc. He had a couple of bullets points for each, but he didn't get into much detail in terms of what each does. I would've liked to have seen more in the way of the positives vs. negatives of each and some recommendations.

Architecture Enforcement with AspectJ (TSE Day 4)

I just attended an extremely interesting session entitled Architecture Enforcement with AspectJ and Other Tools given by Alef Arendsen and Ramnivas Laddad. They first showed Structure101, which gives you a visual representation of your architecture, including displaying package structure, cyclic dependencies, etc. I hadn't heard of Structure101 previously. It looks like there are several versions including both free and for-fee.

They next showed several examples of using AspectJ to enforce architecture rules both at compile-time and runtime. This included rules like:

- don't use straight JDBC, instead use Spring JDBC
- don't return null Collections
- ensure that non-thread safe objects are never accessed by multiple threads simultaneously

It was all AspectJ plus Java. Very cool! The compile-time errors show up as standard compile errors in Eclipse and the runtime errors can be exceptions or some type of log message using Log4j or similar. This presents some very interesting options if you're working on a medium to large-sized team and want to enforce a clean architecture. I can already think of a number of places that this would help us immensely. It sounds like it's well worth the investment. Obviously you'll still want to have a Software Architecture document, but this gives you a way to enforce what's in the document.

I am a little concerned about the runtime overhead of AspectJ for the enforcement of the runtime rules, but it's worth experimenting with to see how much overhead is actually involved. I asked the speakers about this and I'm not sure they understood the question, but they mentioned the overhead was minimal. I'm worried about the case where you wind up with hundreds (or even thousands) of runtime rules and the overhead that is introduced.

Friday, December 14, 2007

GigaSpaces - The Spring Experience Day 3 Afternoon

I just finished attending the session presented by Nati Shalom from GigaSpaces. It reinforced a lot of the ideas I've been reading about in his various white papers and blog entries. I'm extremely impressed with the GigaSpaces technology. If you're not familiar with GigaSpaces, I'd highly recommend taking a look at it if you are writing a mid-size or large-scale application. Basically, it's a grid platform for messaging, processing and data. One interesting thing I learned is that they're holding an OpenSpaces Developer Challenge that officially started on December 10th. Final submissions are required by April 2nd, 2008. First prize is a $10,000 gift card from Amazon, Best Buy, Circuit City and Apple. That's a lot of toys for any geek to have in their hand!