While I am not going to complain as much as this guy: http://planet-geek.com/archives/001120.html (a little Java rant I find amusing). There are cases where J2EE's level of abstraction and flexibility has its frustrations (as opposed to .NET where stuff just generally works out of the box). I'm working with the technology stack described in the subject line - and when JBoss first starts up, everything works just fine. However, when you drop a new WAR in the deploy directory and it hot-deploys, but it then displays an error message saying the server is trying to access a connection which is not associated with a ManagedConnection (part of JBoss's mechanism for connection management/pooling).
So, in one of Jboss's many XML configuration files,you can tell JBoss how to check if a connection is valid - either you give it some innocuous piece of SQL to run, or you specify a class which implements ValidConnectionChecker (another JBoss-specific thing). However, ValidConnectionChecker classes are only provided, so far.. for a few RDBMSs, and Informix is not one of them, so you're forced to option 1. Unfortunately, when you try this, the LocalConnectionFactory just hangs upon initialization.. maybe this a bug.
So, for now, I've got a bit of a code that after the Hibernate session factory is configured in Spring, a BeanPostProcessor starts and stops JBoss's ManagedConnectionFactory MBean through JMX, which fixes this for now. Such are the joys of open source.
Comments
That rant was a few years ago :) Life is SOOO much better nowadays with JBoss 4.x and EJB3. I haven't twiddled an XML file in months. Annotations make the heart grow fonder.
Post new comment