You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anand Raman <an...@mymailbag.com> on 2001/02/20 15:22:08 UTC

database locks.. (OT)

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

Re: database locks.. (OT)

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
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



Re: database locks.. (OT)

Posted by Jim Richards <gr...@cyber4.org>.
The usual thing to check for are: Are you using the
database conneciton pool? Are you closing your database
connection? Do use you transactions at all? Do you commit your
work? Do you have autocommit turned on?

Anand Raman wrote:
> 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.