You can certainly do this, but it isn't going to buy you a whole lot.
Without logging for recovery, and transaction coordination provided by the
servers, you'll have to either write lots of stuff yourself, or simply ignore
it.
The testcases we use for testing the RM portaion of JTA outside of EJB are
written exactly like this.
If all you want to do is treat connections to different databases as the same
global transaction, you can do it.
Basically, you'll simulate the coordinator that knows about the fact that the N
JTA transactions to the different databases (XAResources) need to be
prepared/committed as a single Global transaction (in a group).
You can create multiple XAConnections to your target resources. You will be able
to prepare each of the N JTA transactions, then commit them. If crashes occur
anywhere between your first prepare, and your last commit, your sysadmin has
some thinking to do, and probably some manual recovery that is specific to your
RDB. But, the key is, you probably CAN do the recovery by manually rolling back
the prepared transactions (you can even write a tool that you ship with your
application to assist in doing some manual recovery).
Stay away from the classes that the JTA spec says are implemented by the
application server.
Focus on your drivers JDBC 2.0 Standard Extensions and JTA implementation of the
Resource manager parts of JTA. (Depending on your vendor, these may only be
available with the EJB implementation though).
Stick to XAConnection, XADataSource, XAResource and the
javax.transaction.*Exception classes and I'd think you should be fine.
> We're building an application which we're going to make transaction-based,
> and would like to use JTA. We don't want to have all the overhead of a
> full-fledged EJB server though. My questions are - is there a local-only
> implementation of JTA? and has anyone had any experience using JTS outside
> of an EJB server?
> -Bram
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".