Sybase Question:
Download Questions PDF

Optimistic versus Pessimistic locking in Sybase?


Solution #1
Use a timestamp on a header table that would be shared by the common data. This timestamp field is a Sybase datatype and has nothing to do with the current time. Do not attempt to do any operations on this column other than comparisons. What you do is when you grab data to present to the end-user, have the client software also grab the timestamp column value. After some thing time, if the end-user wishes to update the database, compare the client timestamp with what's in the database and it it's changed, then you can take appropriate action: again this is dictated by the business.

Problem #1
If users are sharing tables but columns are not shared, there's no way to detect this using timestamps because it's not sufficiently granular.

Solution #2
... Also are you coding to ct-lib directly? If so there's something that you could have done, or may still be able to do if you are using cursors.

Download Sybase Interview Questions And Answers PDF

Previous QuestionNext Question
How do I force an index to be used in Sybase?Hiding your password to isql in Sybase?