each request is executed inside a thread,
but when you separate your own thread you will get new
resources from tapestry, in your case you will get a new session.
That session will not be commited unless you call ThreadCleanupHub
after thread exits.
Calling ThreadCleanupHub is a must if you use any threaded resources
from tapestry,
otherwise expect strange behavior and memory leaks.

Davor Hrg




On Jan 29, 2008 11:20 AM, Angelo Chen <[EMAIL PROTECTED]> wrote:
>
> found solution, session.flush() at end of the thread, not needed if not in a
> thread, don't know why.
>
>
> Angelo Chen wrote:
> >
> > Hi,
> >
> > I have following code in a service:
> >
> > Rec p = new Rec();
> > session.save(p);
> >
> > p.setName("test");
> > session.save(p);
> >
> > this code works, but if it is invoked in a service under a thread, the
> > change("test") was never saved to the file(the new record is there), any
> > idea?
> >
> > Thanks,
> >
> > A.C.
> >
>
> --
> View this message in context: 
> http://www.nabble.com/T5%3A-Tapestry-Hibernate-and-thread-tp15155391p15156420.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