No, I'm not well-versed with the specs. However, there has been a recommendation for a long time when using OpenJPA with Derby to specify them both so that the <none-jta-datasource> could be used outside JTA for certain operations (like the synchronize mappings). I don't know who makes the decision though. I would imagine it must be someone "JPA aware" since the information is in the persistence.sql. My guess would therefore be OpenJPA.
/Bengt 2016-07-11 11:20 GMT+02:00 Christian Schneider <[email protected]>: > As far as I undetrstood you use the non-jta-datasource if you use local > transactions instead of jta. > I have no clue though why there are these two elements. It is very well > posssible of course that I missunderstood something in the spec. > > Did you find any explanation in the jpa specs about this? > > Christian > > > On 11.07.2016 11:15, Bengt Rodehav wrote: > > Sorry missed your last mail... > > Still wonders when the <non-jta-datasource> would be used? > > /Bengt > > 2016-07-11 11:13 GMT+02:00 Christian Schneider <[email protected]>: > >> On 11.07.2016 10:58, Bengt Rodehav wrote: >> >> >> There is also a difference in the way I published the datasource with >> Blueprint and the way it is being done in pax-jdbc. With Blueprint I >> published both a DataSource and an XADataSource. pax-jdbc is only >> publishing a DataSource but somehow still supports XA (I don't really know >> how this works). >> >> This is something I read in the transaction specs. The user should always >> use a DataSource. XADataSource is just for internal use by the app server. >> The app server has the responsibility of wrapping the XADataSource in a >> DataSource and do the resource enlistment with the TransactionManager. >> >> Christian >> >> >> There is a risk that someone (OpenJPA, JPA Blueprint, ...) is checking if >> it is dealing with a DataSource or an XADataSource. If the first then auto >> commit should be OK, if the latter not and it may then try the >> <non-jta-datasource> instead. Since we are only publishing a DataSource >> (via pax-jdbc) it could signal to a client that auto commit is OK since >> this is not an XADataSource. Do you agree? >> >> /Bengt >> >> -- >>> Christian Schneiderhttp://www.liquid-reality.de >>> >>> Open Source Architecthttp://www.talend.com >>> >>> >> >> >> -- >> Christian Schneiderhttp://www.liquid-reality.de >> >> Open Source Architecthttp://www.talend.com >> >> > > > -- > Christian Schneiderhttp://www.liquid-reality.de > > Open Source Architecthttp://www.talend.com > >
