Hi all,

I know this is mostly a PHP-centric forum, but I'm hoping there's a Java head or two around here that might have some insight into this.

I'm going to be writing my server app in Java Servlets (no Beans, I still don't get that concept yet. ). I'm using Hibernate to handle the object mapping to SQL. As I understand it, Hibernate's transaction system normally uses straight JDBC transactions, but can use a JTA (Java Transaction API) UserTransaction, I guess, also.

Alongside SQL/JDBC transactions, I'm using JNDI for LDAP, and maybe also IMAP access through JavaMail. Also some filesystem management (user home directories, etc). Obviously, unlike JDBC, none of these have any concept of a transaction. But one of my *really would like to have* features in the system, for my sake, would be to have a request-global transaction.

Say for a user creation request, I'd have a global transaction that encompasses creating the user account in LDAP, creating their filesystem home, creating their IMAP mailbox, and then doing some billing stuff in SQL. If any one part of those operations fails, I want the overall transaction to fail.

To me, and the (admittedly little) reading I've been doing, this is the realm of JTA, in a sense. So... I'm guessing I would have to write JTA drivers for LDAP, IMAP, filesystem, etc in order to essentially "emulate" a transaction and provide emulated commit & rollback abilities.

Am I thinking along the right lines here? Any pointers on how to go about doing this? Sun's API docs on JTA are joyously obtuse, I think.