Hi Nikolai, I also agree that it would be great to include transactions in our samples. Obviously part of that involves enlisting XA resources with the transaction manager. I believe that the best way to do this is, as Alasdair says, to adapt the XADataSource into a vanilla DataSource, with some automatic logic to enlist the XAConnections in active transactions.
JPA does make use of a JTA DataSource in managed environments, but the JPA provider expects to be provided with a DataSource that is automatically enlisted, not an XADataSource. This is another reason why the implementation Alasdair suggests would be useful. We could then re-use one implementation throughout Aries, rather than having a specific implementation for the JPA container. As far as I am aware there is no implementation that provides this behaviour in Aries, so it would definitely be welcome if you wanted to provide it. Regards, Tim > Date: Wed, 13 Jan 2010 14:25:35 +0000 > Subject: Re: Transaction samples > From: [email protected] > To: [email protected] > > Hi Nikolai, > > I agree we definitely need to have a sample showing how transactions > work. I had been thinking of updating the blog sample to include > transactions, but nothing immediate. If you want to go ahead and > either update the blog sample, or introduce a new one I think that > would be great. > > Since you mention the JDBC specification for derby I think it would be > good to have an implementation of this. It would be really nice if it > could adapt the XADataSource into a DataSource so the client would > just use the DataSource API, and would implicitly get the transaction > enlistment. I would do this separately from the sample and the derby > bundle you mention. > > I'm not sure I can answer your JPA question, but other will be able to. > > Thanks > Alasdair > > > 2010/1/13 Tankov, Nikolai <[email protected]>: > > Hi, > > > > I was checking the examples and saw that there are no examples which > > demonstrate how transactions (JTA Transaction Services Specification) and > > DB drivers (JDBC Service Specification) can be used. > > Do you plan to include transactional scenario in one of the existing > > examples? If no I can extend Derby bundle with an implement of interface > > org.osgi.service.jdbc.DataSourceFactory defined into OSGi enterprise spec. > > After that I can use it together with the existing transaction > > implementation in a simple example. > > What do you think about this idea? > > > > The implementation of JTA DataSource for JPA is also interesting. Are there > > any plans for an implementation? Or it is implemented but I did not found > > it :) > > > > Thanks! > > Nikolai. > > > > > > > > > > -- > Alasdair Nottingham > [email protected] _________________________________________________________________ Tell us your greatest, weirdest and funniest Hotmail stories http://clk.atdmt.com/UKM/go/195013117/direct/01/
