Adeel:
isn't it better to check at the time of update. just match the previous values from the DB values.
Yes. I think we're saying the same thing. But instead of doing something like:
I think:
would work.
also...
where *would* we keep this version attribute?
It doesn't need to be anything complex. An additional column in any tables is probably sufficient. It would probably need an index or clustered index upon it, along with the primary key.
It would be the responsibility of the business object's model to keep track of the version key and verify its integrity (ie it matches what's in the db) when an update (db write) occurs.
Now... as to your possible solution, Srini...
have a couple of columns in the table Sys_creation_Date & Sys_Update_Date
One major hurdle we've come up against is that small tables with fast hardware can actually cause the JDBC writes to appear to be at the same time. Eventhough the db might have the ability to provide the chrono resolution necessary, often JDBC just couldn't keep up.
The versioning (or Optomistic Locking, as Paul put it) has really saved us quite a bit of time and energy.
Good luck!
-daniel