[jboss-dev-forums] [Design of JBoss Transaction Services] - Re: UserTransactedStartedListener
adrian@jboss.org
do-not-reply at jboss.com
Wed Oct 1 08:58:43 EDT 2008
As an aside there's still one other part of the CCM that needs changing
such that it can work without a TM configured.
This is the code that tries to hand off connection close checking to the
end of the transaction if it exists and hasn't already ended.
| private CloseConnectionSynchronization getCloseConnectionSynchronization(boolean createIfNotFound)
| {
| try
| {
| Transaction tx = tm.getTransaction();
| if (tx != null)
| {
| TransactionSynchronizer.lock(tx);
| try
| {
| CloseConnectionSynchronization cas = (CloseConnectionSynchronization) TransactionSynchronizer.getCCMSynchronization(tx);
| if (cas == null && createIfNotFound && TxUtils.isActive(tx))
| {
| cas = new CloseConnectionSynchronization();
| TransactionSynchronizer.registerCCMSynchronization(tx, cas);
| }
| return cas;
| }
| finally
| {
| TransactionSynchronizer.unlock(tx);
| }
| }
| }
| catch (Throwable t)
| {
| log.debug("Unable to synchronize with transaction", t);
| }
| return null;
| }
|
This obviously needs some rewrite in the way it works.
i.e. it needs to handle the case where there is no TM
I guess the easiest solution is to have transaction-jboss-beans.xml
inject the TM into the TransactionSynchronizer and then have the CCM
delegate all TM operations to the TransactionSynchronizer.
But this solution has the problem that a JCA implemenation detail is configured
inside the transaction manager config. Although this might be appropriate for
easily removing TM support, it is not appropriate for the opposite case
where the TM is used without JCA.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4179785#4179785
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4179785
More information about the jboss-dev-forums
mailing list