You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Daniel Dias Dos Santos <da...@gmail.com> on 2020/04/13 14:14:41 UTC

TomEE + HIbernate 5 doubt

Hello friends,

I have a doubt about using Hibernate 5 in TomEE .

Why I have that use the  <property name="tomee.jpa.factory.lazy"
value="true" />  in persistence.xml for work fine ?

I find an article about this [1] , but I not understand right about your
use .
someone can explication about this ?

[1]
https://fmdojo.wordpress.com/2017/05/07/tomee-7-and-hibernate-5-2-persistence-xml/

  thanks :  )

Re: TomEE + HIbernate 5 doubt

Posted by Daniel Dias Dos Santos <da...@gmail.com>.
Hello  Jon,

yes, the example work fine for me . :  )

my doubt is are more the why I need use the   <property
name="tomee.jpa.factory.lazy" value="true" />   :  )

thanks for explication :  )
--

*Daniel Dias dos Santos*
Java Developer
SouJava & JCP Member
GitHub: https://github.com/Daniel-Dos
Linkedin: www.linkedin.com/in/danieldiasjava
Twitter: http://twitter.com/danieldiasjava


Em ter., 14 de abr. de 2020 às 06:12, Jonathan Gallimore <
jonathan.gallimore@gmail.com> escreveu:

> Hi Daniel
>
> Does this example work for you?
> https://github.com/apache/tomee/tree/master/examples/jpa-hibernate? It
> should be using Hibernate 5.4.
>
> I'll attempt to specifically answer your question - Hibernate appears to
> rely on CDI being available. I don't know why (I don't have that level of
> expertise with Hibenate). When we setup JPA at deploy time, CDI is on the
> classpath, but the various scopes are not available. The flag you mention
> serves as a workaround to enable Hibernate to work in this scenario.
>
> Jon
>
> On Mon, Apr 13, 2020 at 3:15 PM Daniel Dias Dos Santos <
> daniel.dias.analistati@gmail.com> wrote:
>
> > Hello friends,
> >
> > I have a doubt about using Hibernate 5 in TomEE .
> >
> > Why I have that use the  <property name="tomee.jpa.factory.lazy"
> > value="true" />  in persistence.xml for work fine ?
> >
> > I find an article about this [1] , but I not understand right about your
> > use .
> > someone can explication about this ?
> >
> > [1]
> >
> >
> https://fmdojo.wordpress.com/2017/05/07/tomee-7-and-hibernate-5-2-persistence-xml/
> >
> >   thanks :  )
> >
>

Re: TomEE + HIbernate 5 doubt

Posted by Jonathan Gallimore <jo...@gmail.com>.
Hi Daniel

Does this example work for you?
https://github.com/apache/tomee/tree/master/examples/jpa-hibernate? It
should be using Hibernate 5.4.

I'll attempt to specifically answer your question - Hibernate appears to
rely on CDI being available. I don't know why (I don't have that level of
expertise with Hibenate). When we setup JPA at deploy time, CDI is on the
classpath, but the various scopes are not available. The flag you mention
serves as a workaround to enable Hibernate to work in this scenario.

Jon

On Mon, Apr 13, 2020 at 3:15 PM Daniel Dias Dos Santos <
daniel.dias.analistati@gmail.com> wrote:

> Hello friends,
>
> I have a doubt about using Hibernate 5 in TomEE .
>
> Why I have that use the  <property name="tomee.jpa.factory.lazy"
> value="true" />  in persistence.xml for work fine ?
>
> I find an article about this [1] , but I not understand right about your
> use .
> someone can explication about this ?
>
> [1]
>
> https://fmdojo.wordpress.com/2017/05/07/tomee-7-and-hibernate-5-2-persistence-xml/
>
>   thanks :  )
>