I'm debuggin an example like yours,
and although I called ThreadCleanupHub.cleanup()
the list of listeners is empty... and HibernateSessionManager is not in it

something is very wrong

Davor Hrg

On Feb 7, 2008 9:35 PM, Davor Hrg <[EMAIL PROTECTED]> wrote:
> you did'nt say if the entity is saved to db,
>
> if you call commit explicitely,
> you'll see changes in log,
>
> but the way the snippet works is
>
> you create entity, you save it to session
> you change entity...
>
> after your task is done, ThreadCleanupHub.cleanup() is called
> HibernateSessionManager is a listener for that and calls commit then.
>
> so your changes are writen to the database at the end,
> not every time you modify something....
>
> or, am I missing sth ?
>
> Davor Hrg
>
>
> On Feb 7, 2008 4:42 PM, Angelo Chen <[EMAIL PROTECTED]> wrote:
> >
> > Hi Davor,
> >
> > Thanks for your ThreadSource, it works and makes threaded tasks in T5
> > easier, I have included it in my app. however, in my case, the threaded
> > service has insert and update in the same time:
> >
> >         Doc doc = new Doc();
> >         session.save(doc);
> >         doc.setTitle("test");
> >
> >         in the Hibernate log, it has :
> >         insert into doc...
> >
> >         but you can't see update and commit.
> >
> >         if I add a sessionManager.commit() then I can see:
> >         update doc set...
> >
> >         [DEBUG] JDBCTransaction committed JDBC Connection
> >         [DEBUG] JDBCTransaction begin
> >         [DEBUG] JDBCTransaction current autocommit status: false
> >
> >         so commit somehow works.
> >
> > A.C.
> >
> >
> > Davor Hrg wrote:
> > >
> > > you should call ThreadCleanupHub.cleanup() at the
> > > each thread you spawn for your self, or tapestry threaded
> > > resources will not get cleaned, and youl make a mem leak.
> > >
> > >
> > > tapestry uses ThreadLocal to store threaded services like Session,
> > > for example if any part of the code references session(calls a method)
> > > while it is
> > > executed from your thread new session for that thread will be created,
> > > and without calling ThreadCleanupHub.cleanup() inside that thread service
> > >
> > >
> > >
> >
> >
> > --
> > View this message in context: 
> > http://www.nabble.com/T5%3A-Hibernate-and-threaded-service-tp15328171p15336338.html
> >
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > 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]

Reply via email to