Bob,

Finally i got a better insight on the problem, the thing is a java threading 
thing, i should synchronize on the subject of modifications, in my particular 
case a project instance that contains the documents users are uploading, the 
documents themselves are then subject to aproval...

project ----- * document

I guess that it may help using a command pattern: using transactions for 
business operations and synchronizing on the transaction may be a good idea.

For now, the session object is working fine, and it's not feasible that others 
sessions try to upload a document in the project at once. In fact we begin to 
notice the problem when we introduced a file conversion on the fly, that 
incremented the time of the request, this cause impatient users to resubmit the 
page, that finally gave the problems afore mentioned.

May be some explanation of standard patterns for synchronization on web 
applications could help on this, because i see that it's the operation and the 
subject of the operation that should synchronize.

Thanks
Hans

----- "Bob Schellink" <[email protected]> escribió:

> Bob Schellink wrote:
> > You mean you only want one request to be processed at a time for all
> 
> > users? In that case you could synchronize on
> > the ServletContext which is application scoped:
> > 
> > public void onInit() {
> >    Context context = getContext();
> >    synchronize(context.getServletContext()) {
> > 
> >    }
> > }
> 
> 
> Just to reiterate, the above statement will effectively block the 
> entire application from other users while the document validation 
> process in progress. You probably don't want that unless that the 
> server is only used by a single user...
> 
> bob

-- 
Hans Poo, WeLinux S.A.
Oficina: 697.25.42, Celular: 09-319.93.05
Bombero Ossa # 1010, Santiago

Reply via email to