Saturday, August 26, 2006

The Return of the Database - who needs more "middleware"?

Maybe it's just my organization's policy of giving its developers relatively free access to db's while, at the same time, putting lots of administrative hurdles and hurdle-like administrators between them and the app-server. But it's really amazing how little there is that you can't get done nicely with a sturdy db and a decent servlet-container (at most).
Example: For some time I thought a nice event-driven architecture I was planning would require some serious investment (of money and effort) into some sort of enterprisy message-bus, and, of course, then you'd have at least 2 transactional resources to keep synchronised, crying for some "serious" app-server... When I suddenly asked myself, why the hell one ta-resource, the database wasn't enough. And it is, I think. For small-scale integration tasks, where we can control the deployment of all involved systems, business components shared across applications and working on the same database will do just fine. For more difficult tasks requiring some more decoupling there's stuff like Oracle Advanced Queuing - which can be used as a JMS implementation backed, ultimately, by db-tables. Similar things should be easy to implement on any db.
And the best thing: only one ta-resource, only jdbc, no need for two-phase-commit, old Tomcat will do.

Monday, February 27, 2006

KickStart is now Honeycomb, release 0.3 out

Kickstart has moved from SourceForge to JavaForge, and it's changed its name to Honeycomb (alluding to the central role that HiveMind plays in it). Honeycomb integrates Tapestry with Hibernate for painless full-stack web-dev-support.
New features comprise

  • A hibernate DataSqueezer

  • Pluggable Audit-Trail via hibernate interceptor

  • Support for session per request pattern via simple config switch.

Sunday, January 15, 2006

With Kickstart 0.2 Tapestry supports the hibernate session-per-conversation pattern out of the box

I've uploaded a new release of KickStart. Improvements are:

  • Full support for the hibernate-session-per-conversation pattern. See hibernate.org for more.

  • fixed wrong unsaved-value-mapping

Saturday, January 07, 2006

KickStart integrates Tapestry with Hibernate for painless full-stack web-dev-support

While Web-Development with Java is supported by a variety of great frameworks it is still not easy (even tedious) to, firstly, choose the right ones for a given problem and, secondly, make them work together. (needless to refer to all the envious appraisals of RoR and, yes, even Visual-Studio by Java-developers).

I've set up a Sourceforge project, called KickStart, (first download available right now!). It's goal is to get newbies started with the most cutting edge JEE-stuff immediately, and even more important, to provide a platform to discuss the non-trivial task of glueing together the most powerful of the existing Java-frameworks into something that "just works". I believe that all the interesting problems (and solution-patterns) of framework integration patterns recurring in mailing lists and wikis deserve being collected and made available in the form of preconfigured templates for whole applications.

Kickstart strives to provide a selection of integration-patterns with well defined domains of application. Each pattern comes with a complete template application getting you kickstarted with your application in minutes.

For the time being, Kickstart is based on Tapestry, Hivemind and Hibernate. Also, Kickstart is in an early state. While it works, there's only one application pattern and template supported right now. But nevertheless, please try it and tell me whether it works for you.

Sunday, October 23, 2005

Finally no more clob-clipping: Oracle 10g supports standard JDBC CLOB-handling

The new enhancements in Oracle JDBC 10g promises to simplify the insertion and retrieval techniques for the CLOBs using the standard APIs.

Handling Clobs in Oracle 10g

Just discovered the above link after trying to use Oracle's thin JDBC-Driver with Hibernate to save CLOB-data ... This automatically and silently nullifies the CLOB-field when you try to save more then 4k to it which you are likely to do -- after all it's called a cLob.

Now, finally this seems to be fixed in the 10g-JDBC driver. Up to now, it seems to work fine with our somewhat dated 8i installation. Keep my fingers crossed that it stays that way. I'd hate having to resort to the fat oci-driver ...

Wednesday, October 19, 2005

Apache DBCP - never forget maxWait

Had some not so cozy hours debugging a productive app on Tomcat. The thing would spontaneously hang about once a day (The whole of Tomcat, apart from JMX was completely hung). It hung in an infinite wait in the Database-Pool. Funnily the default of the maxWait-Param is "-1", i.e. infinitely. Now, after I fixed this it runs nicely.
But it's still not clear to me, where the total deadlock came from... Maybe some thread which would not release it's connection before it got another one (to a different DB).

Wednesday, October 05, 2005

The Scattered State-Machine - An Antipattern for Web-Controllers

Like a lot of popular anti-patterns the scattered controller stems from the naive implementation of a seemingly obvious abstraction. The reasoning goes like this: Web-Apps show some html-page, each user event (http-request) triggers an action which, in turn, results in an event determining the next state which is either an action or a an html-page transferred back to the user's browser. So, use the old recipe for desaster: Make each noun of your problem description a class, let the resulting "state-machine" be "declaratively" defined using obscure tables or, more fashionable, xml (ok, luckily, xml is not that fashionable anymore). - And voila, you did it. You've polluted your whole controller with a verbose, scattered "state-machine", the internal workings of which are distributed across a host of artifacts: page-template, action-classes, state-machine-spec, events. And most of the time, all you want to do is: Just call a method and display the results ...

Struts apps are particularly notorious for this Anti-Pattern. If you want to know just how complicated you can make the good old library-search scattering your event-urls not only throughout jsp, java-code and struts-config but also through a spring context, see this ibm-dev-works article