Assuming that you have that kind of logic in IoHandler, wouldn't this affect
performance?  

Normally output to the client is determined after processing some input.  So
suppose we use a workerpool, like you have mentioned, to do some processing
for us (possibly use Spring to get us some data from the database) and write
the output in the same workerpool thread.  This is what I have done in my
other post.  It's quite possible that flushing the output would occur in the
next selector.select()-blocking-execution cycle, which takes at least 1s
because MINA doesn't have the traffic masks updated properly to do an actual
write to the client.

Am I understanding this properly?

Rob Butler wrote:
> 
> Your making things more complex than they need to be.
> 
> Spring uses proxy objects for transaction management.  The proxy object
> takes care of adding objects to the ThreadLocal when the proxy method is
> entered and removing them before the proxy method is exited.  If you have
> your thread pool before the proxy object and don't do anything strange to
> "release" the thread from within the nested code everything will work
> fine.
> 
> WorkerPool (allocates thread)
>     |
>     Spring proxy
>         --> start txn add stuff to ThreadLocal
>         --> call proxied method to do actual work
>         --> close (commit/rollback) txn, remove stuff from ThreadLocal
>     Exit spring proxy
>     |
> Return Thread to WorkerPool 
> 
> 
> ----- Original Message ----
> From: Urmeli <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Sent: Sunday, April 15, 2007 8:01:03 AM
> Subject: Re: MINA and ThreadLocals used in other frameworks
> 
> 
> The problem is: how can the frameworks determine the logical end of the
> thread (the point in time when the thread is returned to the pool). In our
> project we use HiveMind as the IoC container. HiveMind has the feature to
> mark the entry and exit of a processing thread and all thread-bound
> components can register a cleanup listener that is notified when the
> thread
> is marked as exited. Works very well for us. I don't know if Spring has
> anything similar ...
> 
> Mike
> -- 
> View this message in context:
> http://www.nabble.com/MINA-and-ThreadLocals-used-in-other-frameworks-tf3576237.html#a10001649
> Sent from the mina dev mailing list archive at Nabble.com.
> 
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/MINA-and-ThreadLocals-used-in-other-frameworks-tf3576237.html#a10005156
Sent from the mina dev mailing list archive at Nabble.com.

Reply via email to