This content has been marked as final.
Show 2 replies
-
1. Re: TransactionManagerLocator has instance before TM is read
adrian.brock Nov 4, 2008 9:58 AM (in response to wolfc)No. If you want to do that, i.e. a real dependency, don't use the TransactionManagerLocator.
You should inject it directly, see jca-jboss-beans.xml:<!-- The transaction manager --> <property name="transactionManager"><inject bean="TransactionManager" property="transactionManager"/></property>
If you wanted to further an just use the anonymous inject, i.e.@Inject // No name implies match the interface to the only implementation public void setTransactionManager(TransactionManager tm); or xml equivalent <property name="transactionManager"><inject/></property>
Then we'd need to make MC aware of the instance in transaction-jboss-beans.xml<bean name="RealTransactionManager"> <constructor factoryMethod="getTransactionManager"> <factory bean="TransactionManager"/> </constructor> </bean>
Since the thing called TransactionManager is not really a TM, its a factory for it. :-) -
2. Re: TransactionManagerLocator has instance before TM is read
wolfc Nov 4, 2008 10:25 AM (in response to wolfc)Bugger, can't get static instances past you. ;-)
I'm going for the anonymous inject.