Hi DH, That sounds doable, we will inject the HibernateSessionSource then call create() to obtain the session?
Angelo dh ning wrote: > > Maybe you can directly use HibernateSessionSource service instead of > HibernateSessionManager. > HibernateSessionSource.create() creates a new session always, and do > remember to commit and close the session by yourself. > > Thanks, > DH > > > ----- Original Message ----- > From: "Angelo Chen" <angelochen...@yahoo.com.hk> > To: <users@tapestry.apache.org> > Sent: Wednesday, March 11, 2009 11:16 AM > Subject: T5ï¼s getting new Hibernate session in a lengthy thread > > >> >> Hi, >> >> I need to run a lengthy thread where some database update happens, is >> there >> a way to minimize the time when a Hibernate Session is used? something >> similar to: >> >> do while not done >> >> // do some processing here >> obtain a session >> use the session >> release the session >> >> enddo >> >> If I use HibernateSessionManager, it seems there is no way to release and >> obtain a new session, any idea? >> -- >> View this message in context: >> http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448134.html >> Sent from the Tapestry - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448992.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org