S
Scott Balmos
Hi all,
I've asked this around a few places (especially forum.java.sun.com)
today without being answered. I'm trying to figure out whether my
thought process is right for using JTA transactions.
I'm writing servlets, with most data in SQL, persisted via Hibernate.
However, I also have lots of data in LDAP, IMAP, and the filesystem. I
know JDBC (and really, Hibernate more generally) covers transaction
handling for the SQL side of things. But I was hoping to layer on top a
more general transaction scheme, covering a complete request that may
do changes to all of the above datastores.
My best example is creating a new user. The operation could be creating
the account in LDAP, creating the home directory in the filesystem,
creating the mailbox in IMAP, and then adding some billing info to SQL.
If any one of those operations fails, the whole thing should be rolled
back.
I know LDAP (accessed via JNDI), IMAP (via JavaMail), and the
filesystem don't have a concept of a transaction. So am I thinking
along the right lines of writing an XAResource plugin to JTA for each
of these datastores, which would emulate the commit/rollback/etc
functionality?
Let me know if this seems sane, or if I'm way off base. Thanks!
--Scott
I've asked this around a few places (especially forum.java.sun.com)
today without being answered. I'm trying to figure out whether my
thought process is right for using JTA transactions.
I'm writing servlets, with most data in SQL, persisted via Hibernate.
However, I also have lots of data in LDAP, IMAP, and the filesystem. I
know JDBC (and really, Hibernate more generally) covers transaction
handling for the SQL side of things. But I was hoping to layer on top a
more general transaction scheme, covering a complete request that may
do changes to all of the above datastores.
My best example is creating a new user. The operation could be creating
the account in LDAP, creating the home directory in the filesystem,
creating the mailbox in IMAP, and then adding some billing info to SQL.
If any one of those operations fails, the whole thing should be rolled
back.
I know LDAP (accessed via JNDI), IMAP (via JavaMail), and the
filesystem don't have a concept of a transaction. So am I thinking
along the right lines of writing an XAResource plugin to JTA for each
of these datastores, which would emulate the commit/rollback/etc
functionality?
Let me know if this seems sane, or if I'm way off base. Thanks!
--Scott