Folks (especially Valentin),
I want to fix https://issues.apache.org/jira/browse/IGNITE-1864 (Cannot configure jndiNames for CacheJndiTmLookup). I was going to fix it as Val suggested in comments I think we should deprecate CacheTmLookup interface with its > implementations and txManagerLookupClassName configuration property. We can > use JCache factory instead: > TransactionConfiguration.setTxManagerFactory(Factory<TransactionManager> > factory) I like the idea with Facroty, but I faced with the following API issue. The problem is that TransactionConfiguration in core-module, TransactionManager is a part of jta, but core-module doesn't have jta as a dependency. As a result the suggested API cannot be compiled. I see the following possible solutions (to stay in bounds of solution with Factory): 1. Remove TransactionManager compile time checking from Factory: TransactionConfiguration.setTxManagerFactory(Factory factory) 2. Use the same approach as we already have with CacheTmLookup: TransactionConfiguration.setTxManagerFactoryClassName(String txFactoryClsName) and create interface TransactionManagerFactory extends Factory<TransactionManager> In this way a user gets compile time checking. 3. Add jta dependency into core-module. But I think it's not an option as long as core module doesn't have any dependencies (except jcache). I'd like the first option. Thanks, -- Artem -- |
I think that the 1st solution is the easiest to implement. I would go with
it and show correct usage in javadocs. public <T> void setTxManagerLookupFactory(Factory<T> f) { } public <T> Factory<T> getTxManagerLookupFactory() { return ...; } --Yakov 2015-12-01 17:14 GMT+03:00 Artem Shutak <[hidden email]>: > Folks (especially Valentin), > > I want to fix https://issues.apache.org/jira/browse/IGNITE-1864 (Cannot > configure jndiNames for CacheJndiTmLookup). > > I was going to fix it as Val suggested in comments > > I think we should deprecate CacheTmLookup interface with its > > implementations and txManagerLookupClassName configuration property. We > can > > use JCache factory instead: > > > > > TransactionConfiguration.setTxManagerFactory(Factory<TransactionManager> > > factory) > > > I like the idea with Facroty, but I faced with the following API issue. The > problem is that TransactionConfiguration in core-module, TransactionManager > is a part of jta, but core-module doesn't have jta as a dependency. As a > result the suggested API cannot be compiled. > > I see the following possible solutions (to stay in bounds of solution with > Factory): > 1. Remove TransactionManager compile time checking from Factory: > > TransactionConfiguration.setTxManagerFactory(Factory factory) > > 2. Use the same approach as we already have with CacheTmLookup: > > TransactionConfiguration.setTxManagerFactoryClassName(String > txFactoryClsName) > > and create > > interface TransactionManagerFactory extends Factory<TransactionManager> > > In this way a user gets compile time checking. > > 3. Add jta dependency into core-module. But I think it's not an option as > long as core module doesn't have any dependencies (except jcache). > > I'd like the first option. > > > Thanks, > -- Artem -- > |
Free forum by Nabble | Edit this page |