I think I've figured out to do this now.
i.e. make jta and jca lazy
The changes are required are roughly:
1) java:/UserTransaction, java:/TransactionSynchronizationRegistry
These need to be replaced by something that bootstraps the UserTransaction (JTA implementation) on demand at first use.
There's an issue with it doing this for the TSR:
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4189120#4189120
2) RAR Bootstrap Context
The use of the XATerminator needs making lazy such that first use of the XATerminator
bootstraps JTA
3) CachedConnectionManager
This needs changing such that the transaction manager is injected using
an incallback with cardinality 0..1
i.e. You can run the CCM without a transaction manager, but it can
cutover to using one if it becomes available later
4) Tomcat valves
These need similar processing to the what is described above for the CCM,
i.e. you can run them without the relevant service, but if something bootstraps it
later they will start doing the extra processing.
5) Testing and reasonable error messages when JCA and JTA is not
even lazy/on-demand
My first look at what would happen without JCA and JTA
didn't give the message I expected. I expected to see a problem with
accessing the UserTransaction but instead I got this:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=145579
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4189122#4189122
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4189122
The current TransactionManagerService has a lot of its jndi binding code
hardwired.
As part of something I'm trying to do to make jca/jta lazy/optional
for the new web-profile, I need to control the access for the TSR (transaction
synchronization registry).
i.e. I need to know if somebody looks it up and if it is the first use of JTA.
If it is I bootstrap the transaction manager and give them the real TSR.
But this isn't at all configurable.
What I need is:
1) a getTransactionSynchronizationRegistry() method on the TransactionManagerService
2) a way to tell the TransactionManagerService not to bind that object.
Ideally, all the jndi bindings (both where and how) should be controlled by configuration
within transaction-jboss-beans.xml
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4189120#4189120
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4189120