You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by hwaastad <he...@waastad.org> on 2014/11/21 18:27:07 UTC

tomee, eclipselink and polygot persistence

Hi,
I'm still playing around with tomee :-)

So, I'm testing out a polygot persistence configuration but are hitting an
issue which I do not know is a eclipselink or tomee issue.

https://github.com/hwaastad/TomeePolygot.git

I've read using resource_local is the way to go but the tomee logs complains
about:
PU has transactionType JTA, but does not have a jtaDataSource defined

even through my persistenceunits are configured with RESOURCE_LOCAL.

(forcing eclipselink as default provider in system.properties, btw)

Any comments anyone?

br hw





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by hwaastad <he...@waastad.org>.
...and that's just what I like about TomEE!!! (and you guys!)

Got everything working now.
Couple of pom tweeks and:

openejb.force-unit-type=false
javax.persistence.provider = org.eclipse.persistence.jpa.PersistenceProvider

Really like this being in 1.7.2 aswell.

So for those interested, my project is updated.

br hw





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983p4673019.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Thanks reporting it! That's what makes us better :).


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-11-24 10:43 GMT+01:00 hwaastad <he...@waastad.org>:
> Hi,
> yes I read the spec and also that the 2.1 spec is the same.
>
> Very nice that you made the option which is another tool for the tomee
> toolbox. I do not know how glassfish/jboss handles this but I guess they
> also will have the same issue.
>
> I'm starting to get things working, at least on starting container and
> persisting relational data.
> I still have issues regarding mongo, but I'll keep on testing.
> Eclipselink complains about " This operation is not supported for
> non-relational platforms"
>
> Well,
> thanks for implementing cool stuff, Romain :-)
>
> br hw
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983p4673009.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by hwaastad <he...@waastad.org>.
Hi,
yes I read the spec and also that the 2.1 spec is the same.

Very nice that you made the option which is another tool for the tomee
toolbox. I do not know how glassfish/jboss handles this but I guess they
also will have the same issue.

I'm starting to get things working, at least on starting container and
persisting relational data.
I still have issues regarding mongo, but I'll keep on testing. 
Eclipselink complains about " This operation is not supported for
non-relational platforms"

Well,
thanks for implementing cool stuff, Romain :-)

br hw



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983p4673009.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by Romain Manni-Bucau <rm...@gmail.com>.
PS: https://issues.apache.org/jira/browse/TOMEE-1454 you can set it in
system properties or unit properties


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-11-23 10:29 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> Ok, here we go:
>
> (JPA 2.0 spec)
> 8.2.1.5 jta-data-source, non-jta-data-source
> In Java EE environments, the jta-data-source and non-jta-data-source
> elements are
> used to specify the global JNDI name of the JTA and/or non-JTA data
> source to be used by the persistence
> provider. If neither is specified, the deployer must specify a JTA
> data source at deployment or a
> JTA data source must be provided by the container, and a JTA
> EntityManagerFactory will be created to
> correspond to it.
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2014-11-22 11:13 GMT+01:00 hwaastad <he...@waastad.org>:
>> HI,
>> I know, but I did'nt see why it was necessary, using RESOURCE_LOCAL....
>>
>> I've been using eclipselink (and jta) 2.5.x with tomee all the way and I've
>> never had any issues with it. (even in high load production apps either).
>>
>> I'll go on with my nosql PU and see if I need a jta source there aswell.
>>
>> I'll keep you all posted :-)
>>
>> br hw
>>
>>
>>
>> --
>> View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983p4672993.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Ok, here we go:

(JPA 2.0 spec)
8.2.1.5 jta-data-source, non-jta-data-source
In Java EE environments, the jta-data-source and non-jta-data-source
elements are
used to specify the global JNDI name of the JTA and/or non-JTA data
source to be used by the persistence
provider. If neither is specified, the deployer must specify a JTA
data source at deployment or a
JTA data source must be provided by the container, and a JTA
EntityManagerFactory will be created to
correspond to it.


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-11-22 11:13 GMT+01:00 hwaastad <he...@waastad.org>:
> HI,
> I know, but I did'nt see why it was necessary, using RESOURCE_LOCAL....
>
> I've been using eclipselink (and jta) 2.5.x with tomee all the way and I've
> never had any issues with it. (even in high load production apps either).
>
> I'll go on with my nosql PU and see if I need a jta source there aswell.
>
> I'll keep you all posted :-)
>
> br hw
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983p4672993.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by hwaastad <he...@waastad.org>.
HI,
I know, but I did'nt see why it was necessary, using RESOURCE_LOCAL....

I've been using eclipselink (and jta) 2.5.x with tomee all the way and I've
never had any issues with it. (even in high load production apps either).

I'll go on with my nosql PU and see if I need a jta source there aswell.

I'll keep you all posted :-)

br hw



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983p4672993.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Funny: adding a datasource make it starting:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit
name="org.waastad_Polygot-relational_jar_1.0-SNAPSHOTPU"
transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>foo</jta-data-source>
    <class>org.waastad.polygot.relational.Customer</class>
    <properties>
      <property name="javax.persistence.jdbc.url"
value="jdbc:derby://localhost:1527/polygot"/>
      <property name="javax.persistence.jdbc.password" value="satest"/>
      <property name="javax.persistence.jdbc.driver"
value="org.apache.derby.jdbc.ClientDriver"/>
      <property name="javax.persistence.jdbc.user" value="satest"/>
      <property
name="javax.persistence.schema-generation.database.action"
value="create"/>
    </properties>
  </persistence-unit>
</persistence>


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-11-22 10:23 GMT+01:00 Romain Manni-Bucau <rm...@gmail.com>:
> Note you use eclipselink 2.5 which is not compatible with tomee (JPA
> 2.1 vs JPA 2.0)
>
>
> Romain Manni-Bucau
> @rmannibucau
> http://www.tomitribe.com
> http://rmannibucau.wordpress.com
> https://github.com/rmannibucau
>
>
> 2014-11-22 10:00 GMT+01:00 hwaastad <he...@waastad.org>:
>> Hi,
>> tried doing that now, but it did'nt seem to change anything.
>>
>> br hw
>>
>>
>>
>> --
>> View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983p4672990.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Note you use eclipselink 2.5 which is not compatible with tomee (JPA
2.1 vs JPA 2.0)


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-11-22 10:00 GMT+01:00 hwaastad <he...@waastad.org>:
> Hi,
> tried doing that now, but it did'nt seem to change anything.
>
> br hw
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983p4672990.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by hwaastad <he...@waastad.org>.
Hi,
tried doing that now, but it did'nt seem to change anything.

br hw



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983p4672990.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: tomee, eclipselink and polygot persistence

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Did you try setting a non jta datasource and adding in
conf/system.properties:
openejb.autocreate.jta-datasource-from-non-jta-one=false ?

This is our default cause openjpa uses non jta datasource to create the db
even in jta mode.
Le 21 nov. 2014 18:34, "hwaastad" <he...@waastad.org> a écrit :

> Hi,
> I'm still playing around with tomee :-)
>
> So, I'm testing out a polygot persistence configuration but are hitting an
> issue which I do not know is a eclipselink or tomee issue.
>
> https://github.com/hwaastad/TomeePolygot.git
>
> I've read using resource_local is the way to go but the tomee logs
> complains
> about:
> PU has transactionType JTA, but does not have a jtaDataSource defined
>
> even through my persistenceunits are configured with RESOURCE_LOCAL.
>
> (forcing eclipselink as default provider in system.properties, btw)
>
> Any comments anyone?
>
> br hw
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/tomee-eclipselink-and-polygot-persistence-tp4672983.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>