You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by pieter claassen <pi...@claassen.co.uk> on 2010/05/25 07:53:24 UTC

Hibernate session (from Spring bean) during wicketapplication startup

I try to bootstrap my MySQL database during the wicket application strartup
but get the following error with a bootstrap method in my
wicketapplication.java. How should I best get  hold of a transaction during
my wicket startup or if this is not possible, what is the most appropriate
alternative?

Rgds,
Pieter


SEVERE: Exception starting filter wicket-spring-hibernate
org.hibernate.HibernateException: No Hibernate Session bound to thread, and
configuration does not allow creation of non-transactional one here
        at
org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
        at
org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:591)
        at
com.musmato.dao.application.AbstractBaseFactory.getSession(AbstractBaseFactory.java:24)
        at
com.musmato.dao.application.AbstractBaseFactory.getAll(AbstractBaseFactory.java:54)
        at
com.musmato.logic.users.UserTools.getUserbyUsername(UserTools.java:18)

Re: Hibernate session (from Spring bean) during wicketapplication startup

Posted by Igor Vaynberg <ig...@gmail.com>.
pull the platformtransactionmanager out and start a transaction
manually, or use @transactional annotation on some bean managed by
spring.

-igor

On Mon, May 24, 2010 at 10:53 PM, pieter claassen <pi...@claassen.co.uk> wrote:
> I try to bootstrap my MySQL database during the wicket application strartup
> but get the following error with a bootstrap method in my
> wicketapplication.java. How should I best get  hold of a transaction during
> my wicket startup or if this is not possible, what is the most appropriate
> alternative?
>
> Rgds,
> Pieter
>
>
> SEVERE: Exception starting filter wicket-spring-hibernate
> org.hibernate.HibernateException: No Hibernate Session bound to thread, and
> configuration does not allow creation of non-transactional one here
>        at
> org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)
>        at
> org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:591)
>        at
> com.musmato.dao.application.AbstractBaseFactory.getSession(AbstractBaseFactory.java:24)
>        at
> com.musmato.dao.application.AbstractBaseFactory.getAll(AbstractBaseFactory.java:54)
>        at
> com.musmato.logic.users.UserTools.getUserbyUsername(UserTools.java:18)
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org