-
1. Re: JBoss Tx on Tomcat - how to configure DataSource?
marklittle Apr 9, 2007 11:14 AM (in response to asavitsky)By JTA-aware datasource, do you mean an XADataSource?
-
2. Re: JBoss Tx on Tomcat - how to configure DataSource?
asavitsky Apr 10, 2007 9:24 AM (in response to asavitsky)Yes, that's what I mean - got a little mixed up in terminology...
-
3. Re: JBoss Tx on Tomcat - how to configure DataSource?
marklittle Apr 10, 2007 3:47 PM (in response to asavitsky)The TransactionalDriver doesn't give you back an XADataSource, but a wrapped JDBC connection. It's really meant to be used when outside of the application server, i.e., stand alone.
-
4. Re: JBoss Tx on Tomcat - how to configure DataSource?
asavitsky Apr 11, 2007 10:01 AM (in response to asavitsky)Yes, I figured as much about the TransactionalDriver. Now, what about the DataSource? I'm looking for a JTA setup that is deployable on Tomcat (that part is working) and that has the XADataSource that is configured in Tomcat's context files (that's the part I have trouble with).
-
5. Re: JBoss Tx on Tomcat - how to configure DataSource?
jhalliday Apr 12, 2007 7:38 AM (in response to asavitsky)Hi Alex
I'm not clear what you are trying to achieve here. Do you want a datasource which will handle the resource enlistment for you, or just one that supplies XAConnections? -
6. Re: JBoss Tx on Tomcat - how to configure DataSource?
asavitsky Apr 12, 2007 9:45 AM (in response to asavitsky)Resource enlistment is not a requirement at this point, XA support should be enough.
Thanks,
Alex -
7. Re: JBoss Tx on Tomcat - how to configure DataSource?
jhalliday Apr 12, 2007 10:04 AM (in response to asavitsky)In that case there is nothing specific to the JTA implementation and hence your question would probably be better placed on the tomcat mailing lists. However, off the top of my head I'd probably go with a custom resource factory. The standard one in tomcat is basically a wrapper around the DBCP, which knows nothing about XA. You would need an implementation with enough knowhow to create XAConnections in whatever driver specific manner. Pooling is also trickier in an XA environment. You may be better off delegating to the driver's own XADataSource rather than reimplementing that functionality, assuming of course that you don't need to support too many different database drivers!
http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#Adding%20Custom%20Resource%20Factories
Or just use a stripped down JBossAS configuration, which will give you tomcat plus XA aware JDBC connections straight out of the box. -
8. Re: JBoss Tx on Tomcat - how to configure DataSource?
asavitsky Apr 12, 2007 10:52 AM (in response to asavitsky)So, basically, you are saying that for straight XA setup, without resource enlistment, there's nothing JBoss Tx-specific in data source setup, and I could simply use Oracle's own XA? I guess the factories that other JTA providers are using in data source definitions, are mostly for resource enlistment then. Good, it makes more sense to me now :)
Now, in an (unlikely) case that we might require enlistment functionality (I must admit I'm not entirely clear what is it used for) does JBoss Tx offer anything there?
Thanks,
Alex -
9. Re: JBoss Tx on Tomcat - how to configure DataSource?
jhalliday Apr 12, 2007 11:04 AM (in response to asavitsky)Getting an XAConnection is only part of the picture. The resource enlistment is the step that binds the connection and hence the database changes done over it, to a transaction. Without that bit the connection and the transaction don't have anything to do with one another and you may as well use a regular connection with no XA. I was really asking: does your application expect the datasource to enlist the connection on its behalf or does it do this itself. You earlier reply implies the latter, since enlistment is not optional and you don't want the datasource to do it. However, your more recent reply indicates that may not be the case... Anyhow, as for having a datasource that will automatically enlist resources, no we don't. The transactional driver is the closest you will get. You could maybe write a tomcat custom resource factory that wraps the transactional driver. Or once again: use JBossAS, which does have the required functionality. Reinventing the wheel is a Bad Thing.
-
10. Re: JBoss Tx on Tomcat - how to configure DataSource?
weston.price Apr 12, 2007 11:10 AM (in response to asavitsky)
Anyhow, as for having a datasource that will automatically enlist resources, no we don't.
Or use JCA which provides for automatic transaction enlistment, pooling, security etc.
If using JBoss as a whole in your application is putting you off, you can simply remove all the services that are not relevant to your applications (ie EJB). -
11. Re: JBoss Tx on Tomcat - how to configure DataSource?
asavitsky Apr 12, 2007 12:01 PM (in response to asavitsky)Thanks for the clarification. I guess I'll use the non-XA setup for now, as the main goal was to have a JTA implementation up and running (I'm deploying JBoss Seam on Tomcat, and it requires a JTA provider). The JBoss AS is off-limits for our environment - we're using plain Tomcat, with AS environments being reserved for more complex/critical applications. I'd be interested in adding the JCA to the picture, however - is it available as a separate module?
Thanks,
Alex