struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: database locks.. (OT)
Date Tue, 20 Feb 2001 17:56:29 GMT
Anand Raman wrote:

> hi guys
> Please bear with me..  I am facing a typical problem though not directly
> related to struts..
>
> I am using struts to power my web application..
>
> I am trying to implement a multi page form and in some scenario the
> application is hanging because of a database lock which is not going
> away after some DML.
>
> I am not sure if struts has got to do anything with this. I tried out
> the postgresql mailing list too with no success.
>
> Could any one of u suggest a way out or any guidelines. I can post the
> code too if somebody can have a look at it.
>
> Thanks a ton..
> Anand

One policy I follow is to always do a COMMIT or ROLLBACK at the end of each
HTTP request, so that I do not have any database resources occupied while
the user is looking at the response page.  Depending upon the nature of your
transactions, that means you might need to keep state information about the
current operation in the user's session, or in "pending" tables in the
database, until the user completes the entire operation.

This approach is almost a requirement for most connection pool
implementations, because some other user's request will be the next one to
use the connection you're using, and therefore would share any outstanding
database transaction.

Craig



Mime
View raw message