You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by gilbertoca <gi...@gmail.com> on 2016/10/20 11:46:28 UTC

[TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Hello everyone. I hope you're having a good day.

Does openejb-core-hibernate have the same usage as openejb-core-eclipselink
in tomee-embedded-maven-plugin?
I ask because of this:


The plugin setup
https://gist.github.com/gilbertoca/f10e7ef47c0802286a5cdc43b2375d8f

Regards,

Gilberto



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-have-the-same-usage-as-openejb-core-eclipselink-in-tomee-emb-tp4680402.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
we don't read jboss datasource but we deploy an automatic datasource if
none is present. Think you got confused by that. Should be logged BTW
(Auto-adjusting...)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-11-28 15:50 GMT+01:00 wus <wu...@gmail.com>:

> thanks, it was the problem. after i added the resources.xml in project, it
> works fine now.
>
> BTW the error message did say that i should added the missing resource in
> my
> config.
>
> i thought, tomee works fine with coupon-ds.xml from "wildfly swarm", very
> strange :-)
>
>
>
> thx again and best regards,
>
> Shan
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-
> have-the-same-usage-as-openejb-core-eclipselink-in-
> tomee-emb-tp4680402p4680650.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by wus <wu...@gmail.com>.
thanks, it was the problem. after i added the resources.xml in project, it
works fine now.

BTW the error message did say that i should added the missing resource in my
config. 

i thought, tomee works fine with coupon-ds.xml from "wildfly swarm", very
strange :-)



thx again and best regards,

Shan





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-have-the-same-usage-as-openejb-core-eclipselink-in-tomee-emb-tp4680402p4680650.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
this sample shows that it works well :)

isnt the issue that you just didnt define "java:jboss/datasources/CouponDS"
datasource (which BTW should rather be named datasources/CouponDS)?


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-11-27 22:30 GMT+01:00 wus <wu...@gmail.com>:

> thanks for your reply.
>
> i have pushed my code in github(https://github.com/wus/jaxrs-jpa-tomee).
> it
> is a test redemption project with jaxrs, jpa in tomee. you can call to
> redemption(post) endpoint with the following curl cmd:
>
>  curl -i -H "content-type: application/json" -d '{"cardNr": "123454",
> "coupon": "test5"}' "http://localhost:8080/jaxrs-jpa/coupon/redemption"
>
>
> the changes has not been added into the datable. it looks like, no CDI
> Container managed transaction has been started.
>
> best regards,
>
> shan
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-
> have-the-same-usage-as-openejb-core-eclipselink-in-
> tomee-emb-tp4680402p4680647.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by wus <wu...@gmail.com>.
thanks for your reply.

i have pushed my code in github(https://github.com/wus/jaxrs-jpa-tomee). it
is a test redemption project with jaxrs, jpa in tomee. you can call to
redemption(post) endpoint with the following curl cmd:

 curl -i -H "content-type: application/json" -d '{"cardNr": "123454",
"coupon": "test5"}' "http://localhost:8080/jaxrs-jpa/coupon/redemption"


the changes has not been added into the datable. it looks like, no CDI
Container managed transaction has been started.

best regards,

shan




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-have-the-same-usage-as-openejb-core-eclipselink-in-tomee-emb-tp4680402p4680647.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2016-11-25 16:25 GMT+01:00 wus <wu...@gmail.com>:

> i have added <property name="tomee.jpa.factory.lazy" value="true"/> in
> persistence.xml.
> the error was away with 7.0.2. but it doesn't work with the cmt in cdi
> container. the changes have not be committed into DB.
>
>
>
can you share a project which shows that on github? We have some project
with hibernate and that solution working


>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-
> have-the-same-usage-as-openejb-core-eclipselink-in-
> tomee-emb-tp4680402p4680640.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by wus <wu...@gmail.com>.
i have added <property name="tomee.jpa.factory.lazy" value="true"/> in
persistence.xml.
the error was away with 7.0.2. but it doesn't work with the cmt in cdi
container. the changes have not be committed into DB.



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-have-the-same-usage-as-openejb-core-eclipselink-in-tomee-emb-tp4680402p4680640.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by wus <wu...@gmail.com>.
thanks for your quick reply.

i have just find out, the CMT for cdi doesn't work in 7.0.1. 

regards

Shan




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-have-the-same-usage-as-openejb-core-eclipselink-in-tomee-emb-tp4680402p4680639.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
7.0.1 doesnt support cdi with jpa so it works, in 7.0.1 and for hibernate
you can switch off cdi: tomee.jpa.cdi=false or tomee.jpa.factory.lazy=true to
initialize the factory lazily


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-11-25 14:38 GMT+01:00 wus <wu...@gmail.com>:

> it works with version 7.0.1
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-
> have-the-same-usage-as-openejb-core-eclipselink-in-
> tomee-emb-tp4680402p4680637.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by wus <wu...@gmail.com>.
it works with version 7.0.1



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-have-the-same-usage-as-openejb-core-eclipselink-in-tomee-emb-tp4680402p4680637.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by wus <wu...@gmail.com>.
are there any workaround for the "chicken egg" issue?

i am using tomee plus 7.0.2 and openejb-core-hibernate.

Regards,

Shan



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-have-the-same-usage-as-openejb-core-eclipselink-in-tomee-emb-tp4680402p4680636.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2016-10-20 14:21 GMT+02:00 gilbertoca <gi...@gmail.com>:

> Romain Manni-Bucau wrote
> > Hello,
> >
> > First there is no "usage of openejb-core-x in
> > tomee-embedded-maven-plugin".
> > These dependencies were originally there to replace openejb-core in
> > embedding testing (pure openejb).
> >
> > Concretely they just switch the jpa (+ for hibernate the bean validation)
> > implementation. This means that is you define hibernate dependencies
> > yourself this is pretty useless to use that dependency.
> >
> > With hibernate you also have to take care to exclude the conflicting API
> > (jpa and few others).
>
> Thanks for clarify.
>
>
> Romain Manni-Bucau wrote
> > Finally a big warning for hibernate on > 7.0.1: jpa-cdi has a chicken egg
> > issue, to be spec compliant I fixed it for the coming 7.0.2 but for
> > hibernate it implies to start it lazily (there is a property for that)
> > otherwise it will start using CDI before CDI is started (all details are
> > on
> > the associated jira ticket if you are interested).
>
> My intention is use just the default tomee-embedded-maven-plugin config.
> But
> for this I need JPA 2.1 provider.
> Requirement: converters for javax.time and schema-generation.
>
> Any chance of using OpenJPA-3? It seems frozen. I would like to help by
> trying it and reporting issues.
>
>
Hehe "frozen" is quite rude since it got activity last week. Yes it doesn't
move very fast but there are some milestone plans. However converters are
not there yet (at least standard ones) and schema-generation is under
discussion so too early for these features. That said joining openjpa@ list
showing you have some interest on that can help us moving faster on that
than what "we think" is expected.


>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-
> have-the-same-usage-as-openejb-core-eclipselink-in-
> tomee-emb-tp4680402p4680404.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

Posted by gilbertoca <gi...@gmail.com>.
Romain Manni-Bucau wrote
> Hello,
> 
> First there is no "usage of openejb-core-x in
> tomee-embedded-maven-plugin".
> These dependencies were originally there to replace openejb-core in
> embedding testing (pure openejb).
> 
> Concretely they just switch the jpa (+ for hibernate the bean validation)
> implementation. This means that is you define hibernate dependencies
> yourself this is pretty useless to use that dependency.
> 
> With hibernate you also have to take care to exclude the conflicting API
> (jpa and few others).

Thanks for clarify.


Romain Manni-Bucau wrote
> Finally a big warning for hibernate on > 7.0.1: jpa-cdi has a chicken egg
> issue, to be spec compliant I fixed it for the coming 7.0.2 but for
> hibernate it implies to start it lazily (there is a property for that)
> otherwise it will start using CDI before CDI is started (all details are
> on
> the associated jira ticket if you are interested).

My intention is use just the default tomee-embedded-maven-plugin config. But
for this I need JPA 2.1 provider. 
Requirement: converters for javax.time and schema-generation.

Any chance of using OpenJPA-3? It seems frozen. I would like to help by
trying it and reporting issues.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-have-the-same-usage-as-openejb-core-eclipselink-in-tomee-emb-tp4680402p4680404.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: [TomEE 7.0.1] Does openejb-core-hibernate have the same usage as openejb-core-eclipselink in tomee-embedded-maven-plugin?

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

First there is no "usage of openejb-core-x in tomee-embedded-maven-plugin".
These dependencies were originally there to replace openejb-core in
embedding testing (pure openejb).

Concretely they just switch the jpa (+ for hibernate the bean validation)
implementation. This means that is you define hibernate dependencies
yourself this is pretty useless to use that dependency.

With hibernate you also have to take care to exclude the conflicting API
(jpa and few others).

Finally a big warning for hibernate on > 7.0.1: jpa-cdi has a chicken egg
issue, to be spec compliant I fixed it for the coming 7.0.2 but for
hibernate it implies to start it lazily (there is a property for that)
otherwise it will start using CDI before CDI is started (all details are on
the associated jira ticket if you are interested).



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-10-20 13:46 GMT+02:00 gilbertoca <gi...@gmail.com>:

> Hello everyone. I hope you're having a good day.
>
> Does openejb-core-hibernate have the same usage as openejb-core-eclipselink
> in tomee-embedded-maven-plugin?
> I ask because of this:
>
>
> The plugin setup
> https://gist.github.com/gilbertoca/f10e7ef47c0802286a5cdc43b2375d8f
>
> Regards,
>
> Gilberto
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/TomEE-7-0-1-Does-openejb-core-hibernate-
> have-the-same-usage-as-openejb-core-eclipselink-in-
> tomee-emb-tp4680402.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>