Speeding up hibernate startup time using terracotta?

I’m in the middle of creating a conversion utility from one database to another, and I have to reinitialize my Hibernate configuration quite often. When you have a couple of hundred entities that need configuring, starting up Hibernate can take a long time. My initial thought was to serialize the SessionFactory and deserialize it upon each startup.

I didn’t try this yet, but something tells me this won’t work. Call it a nagging feeling. However, it should be possible to run the SessionFactory in a Terracotta cluster and keep that server alive, and connect my conversion utility on startup with the Terracotta cluster. This should make startup times a snap.

Mind you: this is just a thought experiment. If someone has done this before, leave a note!

Eclipse + OS X = unhappy

Eclipse and OS X (10.4 Tiger) makes me unhappy. Today I witnessed something really stupid. I have allocated 768MB for Eclipse (eclipse.ini) and to my amazement, Eclipse was beach balling (being unresponsive for you non-OS X-ers). This beach balling was due to the simple fact that the Java garbage collector was reading in pages from the swap file in order to throw everything away. Woohoo! This took of course over 2 minutes.

I doubt that Java will ever become a consumer technology with this kind of shit.

Why exception messages suck

One of my pet peeves is that library builders take special care to check for errors or exception conditions, but fail miserably to communicate what is wrong and how to fix it. The case today: json-lib (2.1).

I’m trying to use it to serialize a bean to JSON format and to compare it to a JSON serialized bean (it is easier to check text instead of the debugger trees). But the json-lib tells me that there is a cycle in the bean.

Caused by: net.sf.json.JSONException: There is a cycle in the hierarchy!
	at net.sf.json.util.CycleDetectionStrategy$StrictCycleDetectionStrategy.handleRepeatedReferenceAsObject(CycleDetectionStrategy.java:73)
	at net.sf.json.JSONObject._fromBean(JSONObject.java:658)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:182)
	at net.sf.json.JSONObject._processValue(JSONObject.java:2426)
	at net.sf.json.JSONObject._setInternal(JSONObject.java:2447)
	at net.sf.json.JSONObject.setValue(JSONObject.java:1189)
	at net.sf.json.JSONObject._fromBean(JSONObject.java:725)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:182)
	at net.sf.json.JSONObject._processValue(JSONObject.java:2426)
	at net.sf.json.JSONObject._setInternal(JSONObject.java:2447)
	at net.sf.json.JSONObject.setValue(JSONObject.java:1189)
	at net.sf.json.JSONObject._fromBean(JSONObject.java:725)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:182)
	at net.sf.json.JSONObject._processValue(JSONObject.java:2426)
	at net.sf.json.JSONObject._setInternal(JSONObject.java:2447)
	at net.sf.json.JSONObject.setValue(JSONObject.java:1189)
	at net.sf.json.JSONObject._fromBean(JSONObject.java:725)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:182)
	at net.sf.json.JSONObject._processValue(JSONObject.java:2426)
	at net.sf.json.JSONObject._setInternal(JSONObject.java:2447)
	at net.sf.json.JSONObject.setValue(JSONObject.java:1189)
	at net.sf.json.JSONObject._fromBean(JSONObject.java:725)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:182)
	at net.sf.json.JSONObject.fromObject(JSONObject.java:145)

Very informative stack trace indeed.

London Wicket User group assembling?

Our London delegate, Al Maw, is organizing a Wicket meetup in London. If you want to celebrate the imminent graduation of Wicket to an Apache top level project, this is your chance to meet, greet Al and other Wicket community members.

The meeting is scheduled for July 3rd, and pending enough interest. Please announce that you are interested in the meet up in this thread.

Get out of the closet, detach that mouse from your fingers and join the Wicket User Group!