struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Musachy Barroso" <musa...@gmail.com>
Subject Re: JPA in mailreader
Date Mon, 12 Nov 2007 15:48:46 GMT
I haven't used JpaTemplate at all so far.

musachy

On Nov 12, 2007 10:22 AM, Tom Schneider <schneidh@gmail.com> wrote:
> Yes, avoid JpaTemplate, just like HibernateTemplate should be avoided.
>  Shouldn't be necessary with the latest versions of the respective
> frameworks.
> Tom
>
>
> On Nov 12, 2007 9:17 AM, Wes Wannemacher <wesw@wantii.com> wrote:
> > I can agree with that... I'm still thinking of avoiding JpaTemplate
> > though because they indicate that it only exists to help people used
> > to HibernateTemplate / JdoTemplate.
> >
> > -Wes
> >
> >
> > On 11/12/07, Tom Schneider <schneidh@gmail.com> wrote:
> > > My vote is to just use spring, for both EntityManagerFactory injection
> > > and Transaction Management.  As Richard and I were discussing this
> > > weekend, Spring is a very common framework when used with Struts.  It
> > > will also provide a full stack Struts/Spring/JPA example.
> > > Tom
> > >
> > > On Nov 12, 2007 9:05 AM, Wes Wannemacher <wesw@wantii.com> wrote:
> > > > Hello,
> > > >
> > > > I've been quietly learning JPA / implementing a JPA struts2-mailreader.
> > > >
> > > > I have a judgment call to make now and wanted some input. At first I
> > > > was hoping to create this in a non-IoC fashion. This was simply to
> > > > keep the dependencies at a minimum and concentrate on integrating JPA
> > > > and struts2. But, in many spots, the JPA docs indicate that the
> > > > EntityManagerFactory should be injected (although it isn't that hard
> > > > to instantiate by hand). I've thought about using Spring, which will
> > > > make things pretty easy with it's transaction management and DI. It
> > > > has been suggested to me to use the JpaTemplate, but while I was
> > > > reading the JavaDoc for it -
> > > >
> > > > http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/orm/jpa/JpaTemplate.html
> > > >
> > > > It indicates that new projects should use a DAO with a shared EM injected.
> > > >
> > > > If I make DAOs, I may skip Spring altogether.
> > > >
> > > > Also, I could do the transaction management in the DAO implementations
> > > > or try to hook into the transactional management of an ee server. If I
> > > > manage the transactions myself, it will make mailreader work in non-ee
> > > > servers as well. However, if this is a "best-practices" example, I
> > > > should probably use the ee server. What do you guys think will be the
> > > > best approach.
> > > >
> > > > -Wes
> > > >
> > > > --
> > > > Wesley Wannemacher
> > > > President, Head Engineer/Consultant
> > > > WanTii, Inc.
> > > > http://www.wantii.com
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: dev-help@struts.apache.org
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: dev-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> >
> > Wesley Wannemacher
> > President, Head Engineer/Consultant
> > WanTii, Inc.
> > http://www.wantii.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message