-
1. Re: UOW port to JCA adapter for JBAS-3183
adrian.brock Aug 31, 2006 10:10 AM (in response to weston.price)The XIDFactory is a red-herring.
It is only used when it is configured with an XAConnectionFactory
and it knows it is going to eventually use 1PC, i.e. there will
be no other resources in the transaction.
This will be true for BMT or CMT/NotSupported.
In this case, it optimizes away the JTA transaction and drives
the "transaction" itself.
All it needs is a mechanism to generate unique XIDs
so it can control the XAResource.
Using the XIDFactory from JBossJTA is one mechanism,
but not necessarily the cleanest, especially when
we are moving to JBossTM for JBoss5 anyway. -
2. Re: UOW port to JCA adapter for JBAS-3183
adrian.brock Aug 31, 2006 10:13 AM (in response to weston.price)Equally, it could just create a real JTA transaction anyway.
For 1PC these have very little overhead. -
3. Re: UOW port to JCA adapter for JBAS-3183
weston.price Aug 31, 2006 10:14 AM (in response to weston.price)
Using the XIDFactory from JBossJTA is one mechanism,
but not necessarily the cleanest, especially when
we are moving to JBossTM for JBoss5 anyway.
Right, which caused me to think about this prior to using this mechanism. -
4. Re: UOW port to JCA adapter for JBAS-3183
weston.price Aug 31, 2006 10:18 AM (in response to weston.price)
Equally, it could just create a real JTA transaction anyway.
For 1PC these have very little overhead.
This would seem to be the best approach to me since we wouldn't have to rely on the 'useLocalTX' flag and just create a transaction under any circumstance. It definitely would make all of this cleaner. -
5. Re: UOW port to JCA adapter for JBAS-3183
adrian.brock Aug 31, 2006 10:21 AM (in response to weston.price)While you are in there, can you also implement this feature?
http://jira.jboss.com/jira/browse/JBAS-3321
This only applies for CMT/Required (for other types the delivery
transcation gets suspended anwyay).
You can find the code for other EJBs in org.jboss.ejb.plugins.TxInterceptorCMT -
6. Re: UOW port to JCA adapter for JBAS-3183
weston.price Aug 31, 2006 10:23 AM (in response to weston.price)Why not? As long as I have the 'patient open'...so to speak.
-
7. Re: UOW port to JCA adapter for JBAS-3183
weston.price Aug 31, 2006 10:26 AM (in response to weston.price)So, eliminating the XIDFactory makes this cleaner, but giving the JmsServerSession still requires the TransactionManager. My plan is to have the JMSActivation look this up via JNDI and provide it to the JmsServerSessionPool.
Obviously when I can *finally* get around to going back to real work and not IBM support we can do this differently. -
8. Re: UOW port to JCA adapter for JBAS-3183
adrian.brock Aug 31, 2006 10:43 AM (in response to weston.price)Are you talking about the JMS inflow?
I thought you were talking about the old server session pool.
Making a resource adapter depend upon a jndi lookup is not very good.
If you want to do something non-portable, I'd rather you allowed
the JBoss BootstrapContext (RARDeployment) let you do a
getTransactionManager().
e.g.-RARDeployment implements BootstrapContext +RARDeployment implements JBossBootstrapContext public interface JBossBootstrapContext extends BootstrapContext { TransactionManager getTransactionManager(); }
TransactionManager tm = ((JBossBootstrapContext) bootstrapContext).getTransactionManager();
In fact, as it currently stands, you can do getXATerminator()
and cast it to a TransactionManager, but that is a different story. :-) -
9. Re: UOW port to JCA adapter for JBAS-3183
adrian.brock Aug 31, 2006 10:45 AM (in response to weston.price)But even that is not clean.
The fundamental issue is that some JMS impls don't support
using the normal JMS API from an XAConnectionFactory,
so you have to drive the XAResource even when you know
a simple jms session.commit()/rollback() would be better. -
10. Re: UOW port to JCA adapter for JBAS-3183
weston.price Aug 31, 2006 10:55 AM (in response to weston.price)Yeah, I wanted to avoid casting anything. But if you are ok with using the JBossBootStrapContext to do it, I am fine with that as well. I was just thinking that if we are already looking up stuff in the JmsActivation via JNDI it would make sense to do the same for the TransactionManager as well.
Casting the Terminator might actually be the lesser of the evils being that we already have that guy via the adapter. Only the code within JmsServerSession would have to change. -
11. Re: UOW port to JCA adapter for JBAS-3183
adrian.brock Aug 31, 2006 11:18 AM (in response to weston.price)It's not the JNDI lookup per-se, but what you are looking up.
It should really be restricted to only lookup admin objects.
In fact, it would be safe to use the org.jboss.tm.TransactionManagerLocator.
We plan to turn this into a portable mechanism to retrieve
the TM implementation for each platform.