Re: T5: Hibernate and threaded service

2008-02-12 Thread Davor Hrg
it works without workarround if you call any service that does not use ThreadCleanupHub namely almost any service other than Session and HibernateSessionManager. On Feb 12, 2008 3:04 PM, Angelo Chen <[EMAIL PROTECTED]> wrote: > > that's good, i have been using ur work around for the 5.09 version.

Re: T5: Hibernate and threaded service

2008-02-12 Thread Angelo Chen
that's good, i have been using ur work around for the 5.09 version. the strange thing about this bug is, sometimes it works even without that work around, but just to be sure, I use the work around all the time, will try that 5.0.11 when it is released. thanks. Davor Hrg wrote: > > this is now

Re: T5: Hibernate and threaded service

2008-02-12 Thread Davor Hrg
this is now fixed for T5.0.11 I've updated wiki to reflect the change. Davor Hrg On Feb 8, 2008 2:55 PM, Davor Hrg <[EMAIL PROTECTED]> wrote: > uh, > oh, > > it seems I've found a small workarround, > not a definitive fix, but the TreadSource works with it.. > > the wiki is updated > > http://wik

Re: T5: Hibernate and threaded service

2008-02-08 Thread Davor Hrg
uh, oh, it seems I've found a small workarround, not a definitive fix, but the TreadSource works with it.. the wiki is updated http://wiki.apache.org/tapestry/Tapestry5HowToRunTaskInThread Davor Hrg On Feb 8, 2008 12:45 PM, Davor Hrg <[EMAIL PROTECTED]> wrote: > this seems to be a JVM bug > ht

Re: T5: Hibernate and threaded service

2008-02-08 Thread Davor Hrg
this seems to be a JVM bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5025230 I tried it in Java 6 and code works just fine I'll look into it, an post a jira... also still trying to make a workarround for it Davor Hrg On Feb 8, 2008 1:29 AM, Angelo Chen <[EMAIL PROTECTED]> wrote: > > Hi

Re: T5: Hibernate and threaded service

2008-02-07 Thread Angelo Chen
Hi Davor, That explains my problem, this happens in 5.0.7 and 5.0.9, never tried it with 5.0.8 Davor Hrg wrote: > > 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

Re: T5: Hibernate and threaded service

2008-02-07 Thread Davor Hrg
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 t

Re: T5: Hibernate and threaded service

2008-02-07 Thread Davor Hrg
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 list

Re: T5: Hibernate and threaded service

2008-02-07 Thread Angelo Chen
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"); i

Re: T5: Hibernate and threaded service

2008-02-07 Thread Davor Hrg
just added : http://wiki.apache.org/tapestry/Tapestry5HowToRunTaskInThread haven't tested it though :) Davor Hrg On Feb 7, 2008 11:51 AM, Davor Hrg <[EMAIL PROTECTED]> wrote: > you should call ThreadCleanupHub.cleanup() at the > each thread you spawn for your self, or tapestry threaded > resourc

Re: T5: Hibernate and threaded service

2008-02-07 Thread Davor Hrg
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 m

Re: T5: Hibernate and threaded service

2008-02-07 Thread Angelo Chen
Hi Andy, Thanks for the quick reply, based on that I modified it as follow: @Inject private HibernateSessionManager sessionManager; Object onSuccess() { final Long id = create.append(); sessionManager.commit(); new Thread(new Runnable() { public vo

Re: T5: Hibernate and threaded service

2008-02-06 Thread Andy Huhn
Hi Angelo, The MyCreate service creates a new record, but doesn't commit until after MyThread is started. The MyThread service automatically gets a different Hibernate Session, and thus can't see the record that hasn't been committed yet by the other session. I'm not that familiar with MySQL, bu

T5: Hibernate and threaded service

2008-02-06 Thread Angelo Chen
Hi, I have two services, namely MyCreate and MyThread, what they do is: MyCreate will append a new record using Tapestry-Hibernate's session and MyThread will look it up, MyThread is in a thread while MyCreate is not, the problem is, the newly created record can not be located by MyThread, if My