SQL-server Timout Expired error...

Results 1 to 2 of 2

Thread: SQL-server Timout Expired error...

  1. #1
    Dharma Guest

    Default SQL-server Timout Expired error...

    Hi there!<BR> I have 10 ASP pages, (all use the same database-but each page using a different table in the database). After going through all the 10 pages(where the user can add/edit/delete records), the user is redirected to a page, which contains &#039;Commit&#039; and &#039;Cancel&#039; butttons. If the user clicks the Commit button, all the information enetered in those forms needs to be committed. On the other hand if he chooses the Cancel button, all the information entered in those 10 pages should be rollbacked.<BR> I am using a SQL-Server7.0 database. Also I have used ADO begintrans/Committrans/Rollbacktrans methods. In order to use this, I am keeping the ADO connection in the session. <BR> Here is the code, I have used to set up the connection in Global.asa<BR> <BR>Sub Session_OnStart()<BR><BR> &#039;setting the connection<BR> set con=server.CreateObject("ADODB.Connection")<BR> con.CursorLocation=2 &#039;adUseServer<BR> con.Mode=3 &#039;adModeReadWrite <BR> con.IsolationLevel=&H00000100 &#039;adXactReadUncommitted <BR> con.Open "dsn=MyDSN;UID=sa;PWD=;"<BR> set session("con")=con<BR> <BR>End Sub<BR><BR><BR>However, I am having the following problem:<BR><BR>* One user accesses Table A via Form A<BR>* At the same time, a second user is accessing Table A via the same form<BR>* When any one of them tries to update Table A via Form A, the user gets the following error.<BR><BR> Microsoft OLE DB Provider for ODBC Drivers error &#039;80040e31&#039; <BR><BR> [Microsoft][ODBC SQL Server Driver]Timeout expired <BR><BR>I think this occurs because the underlying table is locked. Anyway I don&#039;t have a clear idea. Please help me with, what connection string/Isolation level or anyother settings to be given to avoid this error.<BR><BR>Thanx in Advance.<BR>Dharma.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL-server Timout Expired error...

    I&#039;m no DBA, but it looks like you&#039;re running into locking issues. Try using row-level locking so only the record that each person is using is locked, not the whole table.<BR>(I&#039;m assuming of course that each person is not trying to access the same row of data most times.)<BR><BR>BEGIN TRANSACTION<BR>SELECT column FROM table WITH (ROWLOCK)<BR>GO<BR><BR><BR>Hope that helps some.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts