You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ted Husted <hu...@apache.org> on 2007/09/14 20:50:34 UTC
[FRIDAY] JPA War Stories?
Since we've had the Struts2 Spring-JPA tutorial up for a while, I was
wondering if many Struts developers were using a Java Persistence API
implementation nowadays, whether the experience has been positive, and
which implementation folks are using (Hibernate, TopLink, OpenJPA).
So, any JPA war stories to tell?
-Ted.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [FRIDAY] JPA War Stories?
Posted by Piero Sartini <li...@pierosartini.de>.
We do use TopLink Essentials. Beside the somewhat confusing error messages
already mentioned by musachy we are very happy with this choice.
JPA is just great :-)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [FRIDAY] JPA War Stories?
Posted by Alvaro Sanchez-Mariscal <al...@gmail.com>.
We're also using Toplink JPA in Tomcat. Appart from the problems we
had configuring class weaving, it's quite simple for us.
On 9/14/07, Ted Husted <hu...@apache.org> wrote:
> Since we've had the Struts2 Spring-JPA tutorial up for a while, I was
> wondering if many Struts developers were using a Java Persistence API
> implementation nowadays, whether the experience has been positive, and
> which implementation folks are using (Hibernate, TopLink, OpenJPA).
>
> So, any JPA war stories to tell?
>
> -Ted.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Alvaro Sanchez-Mariscal Arnaiz
Java EE Architect & Instructor
alvaro.sanchezmariscal@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [FRIDAY] JPA War Stories?
Posted by nicolas de loof <ni...@gmail.com>.
>
> Venturing slightly (more) off-topic, I recently switched from having
> my DAOs extend from Spring's HibernateDaoSupport, and using
> HibernateTemplate, to just going directly to the Hibernate API. Or,
> now, to the JPA API. I don't benefit from Spring's exception
> translation that way, but you know what? I don't think that really
> matters (in Hibernate 2, it was helpful, but the exceptions have are
> now unchecked). If the applications relied on Spring's DAO
> exceptions, this could make it harder to switch from Hibernate to JPA.
Just for info, simply tagging your DAO classes with @Repository makes
spring handle exception translation.
my 2 cents...
Nico.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [FRIDAY] JPA War Stories?
Posted by Jim Cushing <ji...@mac.com>.
I've been using JPA annotations with Hibernate for a while, but still
using the Hibernate API (SessionFactory, etc.). Those are great, and
I felt right at home with them after using XDoclet to set up
Hibernate mappings for about two years before that.
I'm just getting started using the Persistence API (with Hibernate,
naturally), so it's too early for me to share war stories. So far, so
good, though. While it may sound trivial, that I don't have to
specify the individual annotated classes (or .hbm.xml) is a nice touch.
Venturing slightly (more) off-topic, I recently switched from having
my DAOs extend from Spring's HibernateDaoSupport, and using
HibernateTemplate, to just going directly to the Hibernate API. Or,
now, to the JPA API. I don't benefit from Spring's exception
translation that way, but you know what? I don't think that really
matters (in Hibernate 2, it was helpful, but the exceptions have are
now unchecked). If the applications relied on Spring's DAO
exceptions, this could make it harder to switch from Hibernate to JPA.
Any JPA war stories related to such a switch?
On Sep 14, 2007, at 2:50 PM, Ted Husted wrote:
> Since we've had the Struts2 Spring-JPA tutorial up for a while, I was
> wondering if many Struts developers were using a Java Persistence API
> implementation nowadays, whether the experience has been positive, and
> which implementation folks are using (Hibernate, TopLink, OpenJPA).
>
> So, any JPA war stories to tell?
>
> -Ted.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [FRIDAY] JPA War Stories?
Posted by Musachy Barroso <mu...@gmail.com>.
> I thought I was the only one. I had a tough time getting that
> @Transactional(readOnly = true) sorted out as well. For DAOs that only
> have read only operations, I typically annotate with @Transactional at the
> class level and then with @Transactional(readOnly = true) on all the
> methods. Is that the case for you as well?
>
Yes that's what I do, just that when I forget it I get the cryptic exception.
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [FRIDAY] JPA War Stories?
Posted by Haroon Rafique <ha...@utoronto.ca>.
On Friday at 3:01pm, MB=>Musachy Barroso <mu...@gmail.com> wrote:
MB> I'm using it, and I love it, the only problem I've found so far is
MB> that errors and exceptions do not help at all, like this one I get
MB> from time to time (got it 2 minutes ago):
MB>
MB> javax.servlet.ServletException: java.lang.IllegalStateException:
MB> Attempting to execute an operation on a closed EntityManager.
MB>
MB> which is thrown when you don't mark your read only service method as
MB> @Transactional(readOnly = true). I have had to debug toplink more than
MB> once just to figure out what is wrong on my code. Besides that, it
MB> works like a charm :) (for me)
MB>
Hi Musachy, Ted,
I thought I was the only one. I had a tough time getting that
@Transactional(readOnly = true) sorted out as well. For DAOs that only
have read only operations, I typically annotate with @Transactional at the
class level and then with @Transactional(readOnly = true) on all the
methods. Is that the case for you as well?
For exception handling, I've been using spring AOP annotations since I
also wanted to do some logging using the same SystemArchitecture, so I
have'nt tried the @Repository spring exception handling.
I've been using Toplink Essentials JPA. Its been mostly painless.
MB>
MB> musachy
MB>
Later,
--
Haroon Rafique
<ha...@utoronto.ca>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [FRIDAY] JPA War Stories?
Posted by Musachy Barroso <mu...@gmail.com>.
I'm using it, and I love it, the only problem I've found so far is
that errors and exceptions do not help at all, like this one I get
from time to time (got it 2 minutes ago):
javax.servlet.ServletException: java.lang.IllegalStateException:
Attempting to execute an operation on a closed EntityManager.
which is thrown when you don't mark your read only service method as
@Transactional(readOnly = true). I have had to debug toplink more than
once just to figure out what is wrong on my code. Besides that, it
works like a charm :) (for me)
musachy
On 9/14/07, Ted Husted <hu...@apache.org> wrote:
> Since we've had the Struts2 Spring-JPA tutorial up for a while, I was
> wondering if many Struts developers were using a Java Persistence API
> implementation nowadays, whether the experience has been positive, and
> which implementation folks are using (Hibernate, TopLink, OpenJPA).
>
> So, any JPA war stories to tell?
>
> -Ted.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org