As far as Java development goes, for personal projects and for work, I find myself in that odd place between needing only a servlet container (e.g. Tomcat) and needing a full JEE container. I'm sure this situation is quite common. The one thing that I almost always end up needing beyond plain servlets is JTA. As I've mentioned in the past, I've tried various solutions from plugging in JOTM, which I'm not at all too happy with, to using stripped-down versions of full application servers.
Well, the problem for me is still unresolved, but I did try out Jencks over the weekend. It was fairly easy to set up, and it worked as expected. (Just have to remember to set the connection manager's transaction type to XA to actually get XA transactions!) And rather than using DataSourceMCF, one would probably want to use a real MCF for your database for XA functionality.
Which brings me to the point of this post. In the past I've blogged about problems with PostgreSQL/XA/TranQL (here and here). Although the problem was resolved in the driver long ago, I don't believe I ever published the actual PostgreSQL TranQL connector I made. (And believe me, I would rather fold it back into the original project... but I'm having a hard time finding contact information... or a working mailing list... anything.)
I've tested it with Jencks and Geronimo. (And by "test", I mean I just verified that the PostgreSQL driver is indeed using 2PC.) The source can still be found in the same place: http://www.saddi.com/software/tranql/. You'll probably need to use the latest 8.2 JDBC driver (which includes the above-mentioned fix).
Hopefully anyone searching for TranQL/PostgreSQL will eventually stumble upon it. I mean, I can't be the only person interested in using XA transactions with PostgreSQL in Geronimo, right???
We're in the same boat. After years of writing multithreaded business apps that require transactions on the db via JBoss, we finally got tired of all the plaque and tartar buildup that these massive containers have as evidenced in their many setup files, etc. Spring/Hibernate/etc can no longer, in my view, claim to be "lightweight", either, so we continue to use our own db access code that we've used for years to manage our own db activity, and, yes, we actually write SQL. Amazing how quickly things run when you only do what you need to do.
We only need servlets, db transactions, JNDI, some connection pooling. So, like you, we are also going down this path of using Tomcat exclusively.
What a pain this trip has been. How can it be that something as fundamental as transactional db activity can be so flipping difficult to set up?
Our JOTM effort has been difficult. Connecting to postgres via multiple threads isn't working as advertised (even with the very latest drivers), though single threaded access works fine.
I'm going to try to swap out JOTM for the Atomikos and/or Bitronix and see if things go better.
How is it our industry has gotten so far away from simple fundamentals like transactional db calls?
Allan, could you help me with configuring deployment plan for Postgres XA data source ? I've configured deployment plan for DataPool using javax.sql.DataSource and simple pgres driver, but I want to use XA.