Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Timestamp on Oracle database

Re: Timestamp on Oracle database

From: Frank Zekert <zekert_at_wmd.de>
Date: Thu, 3 Dec 1998 08:05:26 +0100
Message-ID: <745d93$h6v$1@ns2.dokumenta.de>


Veronica schrieb in Nachricht <3665DF58.66E5B473_at_post1.com>...
>On the Oracle database, is a timestamp automatically generated whenever
>a user makes inserts/updates to a table? If so, where is this timestamp
>stored?
>
>I'm trying to develop a client application that accesses an Oracle
>database... I need to make sure that no 2 users are modifying the same
>record simultaneously (thats why I need to check the timestamp). I read
>somewhere that one way is to have 3 additional rows in each table:
>1. TransactionUserName
>2. TransactionTime ( I guess that's something like generating your own
>timestamp?)
>3. TransactionFlag
>Apart from this method, are there any alternatives?

Hi !
most certainly there are alternatives ... as you decided to use a REAL database management system (i.e. ORACLE) you should avoid re-inventing the job of the RDBMS.

I suggest that you let ORACLE do the job by using it's transaction control. Let your application follow this scheme:

  1. select [whatever column] from [whatever table] where [whatever condition] for update nowait;
  2. do some error handling (if the row is already locked)
  3. update [whatever table] set [whatever values] where [whatever condition]
  4. don't forget "commit"

That's about all ;-)

HTH
    Frank Received on Thu Dec 03 1998 - 01:05:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US