Hi
I thought it needed to be created through a factory, also I have some
properties that need to be set, I now do like this,
Now I got EntityManagerFactory =
Persistence.createEntityManagerFactory("Pesistent", props);
can I do that something like this when using jndi,
<Resource>..
<type>org.apache.openjpa.persistence.OpenJPAEntityManagerFactory</type>
<properties key="" value="">
</Resource>
Sorry for all the questions, but Im new to this
Håkon
2008/11/12 Pinaki Poddar <[EMAIL PROTECTED]>
>
> Hi,
> What is
> <Resource ...
> factory="org.apache.openjpa.persistence.OpenJPAEntityManagerFactory"
> ... />
> for?
>
> The type should be
> "org.apache.openjpa.persistence.OpenJPAEntityManagerFactory"
>
>
>
>
> Håkon Sagehaug wrote:
> >
> > Hi
> >
> > for configuring the jndi resource, I use tomcat, would it be something
> > like
> > this
> >
> > <Resource name="enty/EntityManagerFactory" auth="Container"
> > type="org.apache.openjpa.persistence.OpenJPAEntityManager"
> >
> > factory="org.apache.openjpa.persistence.OpenJPAEntityManagerFactory"
> > />
> >
> > Then I can get it in my ws
> >
> > cheers håkon
> >
> >
> > 2008/11/11 Pinaki Poddar <[EMAIL PROTECTED]>
> >
> >>
> >> > One solution is to create a new EntitymanagerFactory in each method
> >> Construction of EntityManagerFactory is a costly affair. Hence repeated
> >> construction should be avoided at all costs. An EMF is a good candidate
> >> for
> >> access via JNDI (akin to DataSource), if one is available.
> >> Some form of singleton pattern is recommended.
> >>
> >> --
> >> View this message in context:
> >>
> http://n2.nabble.com/Where-to-initialize-the-entitymanger-factory-tp1485683p1486001.html
> >> Sent from the OpenJPA Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Håkon Sagehaug, Software Developer
> > Parallab, Bergen Center for Computational Science (BCCS)
> > UNIFOB AS (University of Bergen Research Company)
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/Where-to-initialize-the-entitymanger-factory-tp1485683p1490411.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>
--
Håkon Sagehaug, Software Developer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)