Thread safety is your responsibility, but services are singleton by
default and it shouldn't matter to your DAOs which threads they are
accessed from. What you need to worry about is the consistency of your
data. When you say "the new thread is created to process the data",
what do you mean by it? If you are just writing to the database, then
the database will handle the integrity of the data. If you do some
in-memory processing of the data, then the integrity of it is yours to
handle.

Kalle


On Wed, Sep 1, 2010 at 2:12 PM, Norman Franke <nor...@myasd.com> wrote:
> Will there be some issue with the injected services? This async service when
> created will have it's injected services created in the thread of the
> current web request. When the new thread is created to process the data, the
> services will then be accessed from a different thread.
>
> Norman Franke
> Answering Service for Directors, Inc.
> www.myasd.com
>
>
>
> On Sep 1, 2010, at 4:03 PM, Kalle Korhonen wrote:
>
>> ParallelExecutor is a "service that allows work to occur in parallel
>> using a thread pool". I doubt it's usefulness in your case. Simply
>> create a new service, spawn threads in it as needed to do work and
>> implement a few get status operations that your page(s) can call. That
>> way, keeping the page up-to-date via AJAX is a separate concern.
>>
>> Kalle
>>
>>
>> On Wed, Sep 1, 2010 at 12:06 PM, Norman Franke <nor...@myasd.com> wrote:
>>>
>>> I need a page that will start a long-running process involving heavy use
>>> of
>>> a database. I'm trying to come up with an elegant way to integrate this
>>> into
>>> my T5.1 app. I'd like to use Tapestry's IoC to inject my Hibernate DAOs.
>>> Then I'd like to write status updates to a stack and have an AJAX process
>>> poll and update the web page with what's happening.
>>>
>>> I see there is a ParallelExecutor in Tapestry, but I don't think it does
>>> injection.
>>>
>>> Any good solutions out there?
>>>
>>> Norman Franke
>>> Answering Service for Directors, Inc.
>>> www.myasd.com
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to