|
From: Jonathan H. <jon...@re...> - 2007-06-11 15:02:38
|
Thanks Juergen For our JTA implementation I think the bean wiring is sufficient. No new Java code is usually a good thing! For our JTS it's a bit more complicated as we require the ORB to be configured through our own API. I think though that this initialization code does not belong hidden in the integration at all - I'll probably just document the requirement and leave it to the users to decide where to put the calls. Only a handful of them will need JTS outside the app server anyhow, it's a pretty unusual requirement compared to JTA. So, hopefully the changes needed for integration are limited to documentation and testing. Jonathan. Juergen Hoeller wrote: > Hi Jonathan, > > As outlined in my previous mail on JTA setup, the preferred approach is > setting up a TransactionManager handle as bean and passing it into the > "transactionManager" property of Spring's JtaTransactionManager. There is > usually no need for explicitly setting up a UserTransaction handle as well. > > Our unit tests just test Spring's JtaTransactionManager against > UserTransaction and TransactionManager mocks. So for integration tests, > you'll have to set up an application context with full tx and resource > setup. Should be straightforward when using Spring's > ClassPathXmlApplicationContext class for bootstrapping. > > Juergen > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On Behalf > Of Jonathan Halliday > Sent: Monday, June 11, 2007 3:42 PM > To: spr...@li... > Subject: [Springframework-developer] Spring - JBossTS integration > > > Hello Spring developers > > I'm looking at how best to integrate the JBossTS transaction manager with > Spring2 for usage outside the application server i.e. when no JNDI is > available. > > It seems I need to provide a factory or factories that know about the > JBossTS implementation and can return the classes which implement > TransactionManager and UserTransaction. This is the way the Jotm integration > appears to work, although it's slightly different in that the same object > implements both interfaces in Jotm. > > Would someone (Juergen?) please indicate if this is indeed the preferred > approach? > > Also, is there a way to configure the unit tests so that they exercise this > new code path? If not I guess I'll have to write specific tests for it. > > Thanks > > Jonathan Halliday > JBossTS developer > JBoss, a division of Red Hat. > -- ------------------------------------------------------------ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in UK and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (USA), Charlie Peters (USA) and David Owens (Ireland) |