I'm using JPA entityManger but SpringLazyLoadService needs SessionFactory instead :( any tips? thx heaps!

32 views
Skip to first unread message

@prefabSOFT

unread,
Dec 17, 2010, 10:05:39 AM12/17/10
to dpHibernate
Hi all,

I'm working on a Spring Roo+Flex app using JPA. So I'm using the JPA
entityManager. Though "org.dphibernate.services.SpringLazyLoadService"
needs a hibernate SessionFactory.

Is there some kind of best practice to this or do I need to ditch JPA
and go for just Hibernate?


All comments more than welcome! :)

Beste wishes,

Jochen

Ps: I already tried to explain to problem but since I already have the
error thrown in my clipboard:

2010-12-17 15:35:55,804 [tomcat-http--2] ERROR
org.springframework.web.servlet.DispatcherServlet - Context
initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'dataAccessService' defined in
ServletContext resource [/WEB-INF/spring/flex-config.xml]: Unsatisfied
dependency expressed through constructor argument with index 0 of type
[org.hibernate.SessionFactory]: : No matching bean of type
[org.hibernate.SessionFactory] found for dependency: expected at least
1 bean which qualifies as autowire candidate for this dependency.
Dependency annotations: {}; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No
matching bean of type [org.hibernate.SessionFactory] found for
dependency: expected at least 1 bean which qualifies as autowire
candidate for this dependency. Dependency annotations: {}

Marty Pitt

unread,
Dec 17, 2010, 10:26:34 AM12/17/10
to dphib...@googlegroups.com
Hi Jochen

I'm no expert on JPA vs Hibernate, however dpHibernate is currently pretty
heavily coupled to Hibernate itself. The methods used for determining
foreign key relationships, and finding what's intialized and what's a lazy
proxy are all using hibernate specific methods.

A pure JPA implementation would be cool though. However, I'm really swamped
with other projects at the moment, so wouldn't be able to commit to
implementing this. (Though, please raise a ticket on the googlecode site so
we capture this as a requirement going forward).

Marty

--------------------------------------------------
From: "@prefabSOFT" <jochen....@gmail.com>
Sent: Friday, December 17, 2010 10:05 AM
To: "dpHibernate" <dphib...@googlegroups.com>
Subject: I'm using JPA entityManger but SpringLazyLoadService needs
SessionFactory instead :( any tips? thx heaps!

> --
> You received this message because you are subscribed to the Google Groups
> "dpHibernate" group.
> To post to this group, send email to dphib...@googlegroups.com.
> To unsubscribe from this group, send email to
> dphibernate...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/dphibernate?hl=en.
>
>

Jochen Szostek

unread,
Dec 17, 2010, 10:40:48 AM12/17/10
to dphib...@googlegroups.com
Hi Marty,

Thanks a lot for the fast reply! I was just recreating the project without JPA (luckily flexibility and speed are two of the beauties of Roo :) ) and hope to get it working that way.

Will create that ticket for the JPA support right away, and if I might come up with something that could benefit the project I will surely post something on this list.

Kind regards,

Jochen

David Vree

unread,
Dec 21, 2010, 10:07:55 AM12/21/10
to dpHibernate
I'll second the idea of having a JPA version of dpHibernate that works
with any entity manager.

Does that mean it'll have to be called dpJPA? ;-)

On Dec 17, 10:40 am, Jochen Szostek <jochen.szos...@gmail.com> wrote:
> Hi Marty,
>
> Thanks a lot for the fast reply! I was just recreating the project without
> JPA (luckily flexibility and speed are two of the beauties of Roo :) ) and
> hope to get it working that way.
>
> Will create that ticket for the JPA support right away, and if I might come
> up with something that could benefit the project I will surely post
> something on this list.
>
> Kind regards,
>
> Jochen
>
> On Fri, Dec 17, 2010 at 16:26, Marty Pitt <martyp...@me.com> wrote:
> > Hi Jochen
>
> > I'm no expert on JPA vs Hibernate, however dpHibernate is currently pretty
> > heavily coupled to Hibernate itself.  The methods used for determining
> > foreign key relationships, and finding what's intialized and what's a lazy
> > proxy are all using hibernate specific methods.
>
> > A pure JPA implementation would be cool though.  However, I'm really
> > swamped with other projects at the moment, so wouldn't be able to commit to
> > implementing this.  (Though, please raise a ticket on the googlecode site so
> > we capture this as a requirement going forward).
>
> > Marty
>
> > --------------------------------------------------
> > From: "@prefabSOFT" <jochen.szos...@gmail.com>
> >> dphibernate...@googlegroups.com<dphibernate%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/dphibernate?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "dpHibernate" group.
> > To post to this group, send email to dphib...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > dphibernate...@googlegroups.com<dphibernate%2Bunsu...@googlegroups.com>
> > .

David Vree

unread,
Dec 21, 2010, 10:08:02 AM12/21/10
to dpHibernate
I'll second the idea of having a JPA version of dpHibernate that works
with any entity manager.

Does that mean it'll have to be called dpJPA? ;-)

On Dec 17, 10:40 am, Jochen Szostek <jochen.szos...@gmail.com> wrote:
> Hi Marty,
>
> Thanks a lot for the fast reply! I was just recreating the project without
> JPA (luckily flexibility and speed are two of the beauties of Roo :) ) and
> hope to get it working that way.
>
> Will create that ticket for the JPA support right away, and if I might come
> up with something that could benefit the project I will surely post
> something on this list.
>
> Kind regards,
>
> Jochen
>
> On Fri, Dec 17, 2010 at 16:26, Marty Pitt <martyp...@me.com> wrote:
> > Hi Jochen
>
> > I'm no expert on JPA vs Hibernate, however dpHibernate is currently pretty
> > heavily coupled to Hibernate itself.  The methods used for determining
> > foreign key relationships, and finding what's intialized and what's a lazy
> > proxy are all using hibernate specific methods.
>
> > A pure JPA implementation would be cool though.  However, I'm really
> > swamped with other projects at the moment, so wouldn't be able to commit to
> > implementing this.  (Though, please raise a ticket on the googlecode site so
> > we capture this as a requirement going forward).
>
> > Marty
>
> > --------------------------------------------------
> > From: "@prefabSOFT" <jochen.szos...@gmail.com>
> >> dphibernate...@googlegroups.com<dphibernate%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/dphibernate?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "dpHibernate" group.
> > To post to this group, send email to dphib...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > dphibernate...@googlegroups.com<dphibernate%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages