Hello Jens,
 
> thanks for your answer, but this is not exactly what i was 
> looking for.
> 
> in my application i have a edit-form. user1 wants to edit a 
> record from
> 'tblkunde'. now the record with id=15 is fetched from the 
> database and i put
> it in the edit-form. the connection to the database is 
> closed. now user1
> changes the data and when he has finished he presses a 'save' 
> button. now
> the update-statement is executed.

Usually people do exactly this when making a SELECT FOR UPDATE:

- you get your data to populate the form,
- you have the record locked so no other can write
- others may not read the record unless they don't care about locks

but you cannot do all this if you close the connection to the 
database. The close of a connection aborts the ongoing transaction,
and releases all locks held by the session. 

What if your user abandones the form, or his computer crashes
before 'save' could be pressed?

If your application is absolutely stateless (like a CGI program),
you have no possibly for using that LOCK stuff at all, as locks
live as long as the session live. You may want to add a column 
to your table holding an flag for that editing, or something
similar.

> 
> and here is my problem now:
> as long as user1 has this edit-form open, no other user 
> should be able to
> open this record in his edit-form.
> 

Regards
Alexander Schr�der
SAP DB, SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to