Guest_imported
New member
- Jan 1, 1970
- 0
Hi everyone,
I am currently developing an Update Form for a web implemented database using SQL Server 7.0. Whenever a submitter starts a new session I would like to save his Submission_ID into a session variable in order to use it later as foreign key into other tables in my database.
Under SQL after RS.Update the pointer moves to the next blank record in the table. Therefore, I had to use after Update the
MoveLast.
But obviously under concurrent access the Update and MoveLast are not atomically and I have somehow to enforce this to be one transaction. I need some advice on this issue.
Here is a truncated snapshot of my code:
Set submitRS = Server.CreateObject("ADODB.Recordset"
query1="SELECT * FROM Submissions order by Submission_ID"
submitRS.Open query1,Conn,adOpenStatic,adLockPessimistic
...
submitRS.AddNew
submitRS("Loginname"=Loginname
submitRS("Password"=Password
...
submitRS.Update
submitRS.MoveLast
Session("Submission_ID"=submitRS("Submission_ID"
First idea is to use Application.lock before opening the record set submitRS, but this has will keep the entire application locked and it's not that efficient.
I would like to lock only the Submissions table to prevent other submitters to add a new record before one adds and reads his own Submission_ID.
I will be very grateful if someone can give me any hints on this issue.
Thanks a lot.
I am currently developing an Update Form for a web implemented database using SQL Server 7.0. Whenever a submitter starts a new session I would like to save his Submission_ID into a session variable in order to use it later as foreign key into other tables in my database.
Under SQL after RS.Update the pointer moves to the next blank record in the table. Therefore, I had to use after Update the
MoveLast.
But obviously under concurrent access the Update and MoveLast are not atomically and I have somehow to enforce this to be one transaction. I need some advice on this issue.
Here is a truncated snapshot of my code:
Set submitRS = Server.CreateObject("ADODB.Recordset"
query1="SELECT * FROM Submissions order by Submission_ID"
submitRS.Open query1,Conn,adOpenStatic,adLockPessimistic
...
submitRS.AddNew
submitRS("Loginname"=Loginname
submitRS("Password"=Password
...
submitRS.Update
submitRS.MoveLast
Session("Submission_ID"=submitRS("Submission_ID"
First idea is to use Application.lock before opening the record set submitRS, but this has will keep the entire application locked and it's not that efficient.
I would like to lock only the Submissions table to prevent other submitters to add a new record before one adds and reads his own Submission_ID.
I will be very grateful if someone can give me any hints on this issue.
Thanks a lot.