this can all be done independently of wicket using a servletcontextlistener for sessionfactory start/shutdown and a servlet filter for closing the session at the end of requests. go for the simplest things first :)
-igor On 10/4/07, Stanczak Group <[EMAIL PROTECTED]> wrote: > Another piece I forgot to add is the config and shutting down of the > factory. I use this in the WebApplication: > > @Override > protected void init() { > try { > HibernateUtil.setSessionFactory(new > Configuration().configure().buildSessionFactory()); > } catch (Throwable e) { > Logger.getLogger(getClass()).error(e); > } > } > > @Override > protected void onDestroy() { > HibernateUtil.getSessionFactory().close(); > } > > Neil B. Cohen wrote: > > Martijn Dashorst wrote: > >> According to me you can use Hibernate's thread local session if you > >> want (you still need the custom request cycle though!). This removes > >> the need for all the casting and getting. > >> > >> Session.get().createCriteria(SysUser.class).add(.....).uniqueResult(); > >> ^^^^^^^^ > >> Hibernate session, not Wicket's > >> > >> Martijn > >> > >> > >> > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- > Justin Stanczak > Stanczak Group > 812-735-3600 > > "All that is necessary for the triumph of evil is that good men do nothing." > Edmund Burke > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]