Hi,

Be sure that you use *org.apache.derby.jdbc.EmbeddedXADataSource* and the
XAResource is enlisted in the current transaction each time a connection is
requested.

A good choice can be if you:

   - Instantiate EmbeddedXADataSource. This implements XADataSource
   - Wrap it with commons-dbcp BasicManagedDataSource. This implements
   DataSource and enlists the XAResource each time a connection is requested.
   - Register BasicManagedDataSource as an OSGi service
   - Use the registered OSGi service in persistence.xml

If you use commons-dbcp, be sure that you use at least version 2.0.1.

If you need configurable DS components, you can use:

   - https://github.com/everit-org/osgi-jdbc-dsf (Contains components that
   can pick up a DataSourceFactory OSGi service and register either
   XADataSource or DataSource)
   - https://github.com/everit-org/commons-dbcp-component (Contains a
   configurable component that instantiates BasicManagedDataSource and
   registers it as an OSGi service based on DataSource interface)


Regards,
*Balázs **Zsoldos*


On Wed, Nov 26, 2014 at 3:58 PM, Christian Schneider <
[email protected]> wrote:

> I just opened
> https://issues.apache.org/jira/browse/ARIES-1278
>
> I persist a JPA entity inside a transaction and it is already visible
> before the commit. Does anyone have an idea how this can happen?
>
> Christian
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>

Reply via email to