Platinum Solutions Corporate Website


The devil is in the details (Spring+JBoss+Hibernate+Informix)

The answer you entered to the math problem is incorrect.

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

dbs (not verified) Wed, 1969-12-31 20:00

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

Please solve the math problem above and type in the result. e.g. for 1+1, type 2.
The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.

More information about formatting options