MarshalSHI
MarshalSHI

Reputation: 625

database timestamp

What's the definition of timestamp?
The timestamp is just for a transaction? ( no matter what actions in the transaction. The timestamp is always the time when the transaction happened.)
OR the timestamp is for each action of a transaction? (each action has a timestamp.)
enter image description here

For instance, when first R1(X) happened, it has a timestamp TS. But for the second R1(X), the timestamp is same with the TS? OR the timestamp has changed?

For another example, if I have R1(X)W2(X)W1(X), is it view serializable? and is it conflict serializable?

Upvotes: 0

Views: 3260

Answers (1)

Shiraz Bhaiji
Shiraz Bhaiji

Reputation: 65391

This will probably depend on which database you are using.

For SQL Server the timestamp is retrieved by using GetDate() which returns the current database system timestamp.

So if you insert a row using GetDate to input the timestamp, then 2 seconds later in the same transaction insert another row calling GetDate again, the second call will return a time 2 seconds later.

Upvotes: 1

Related Questions