Subject | Does Firebird expose the db wide 'row version'? |
---|---|
Author | samcarleton |
Post date | 2011-10-08T04:23:42Z |
I am looking into the feasibility of using Microsoft Sync Framework with Firebird 2.5 or 3.0. Microsoft SQL Server exposes a concept which I believe all RDBMS need to have internally, they call it the row version, I am wondering if this is exposed or could be exposed in Firebird.
Here is what the row version is and why I believe the concept exists in Firebird:
SQL Server has a @@DBTS (DataBase TimeStamp), it is *NOT* a timestamp in the sense of time or date. It is simply a sequence number which each time there is an insert or an update to ANY table in the DB, this @@DBTS is increased by one. Microsoft also refers to this as the ROW VERSION.
Then Microsoft has this concept of the MIN_ACTIVE_ROWVERSION, which they state "The MIN_ACTIVE_ROWVERSION function returns the lowest active timestamp (also known as rowversion) value in the current database. A timestamp value is active when it is used in a transaction that has not yet been committed. If there are no active values in the database, MIN_ACTIVE_ROWVERSION returns the same value as @@DBTS + 1."
So the reason I believe Firebird has this concept somewhere is because it is only logical that the engine uses the same basic concept to allow a client to get commited data and not get uncommited.
All in all the reason I need this value is for the reasons stated in the Microsoft Sync Framework, you sync up to the MIN_ACTIVE_ROWVERSION as not to try to get any rows that are in an active transaction, then you record that value so that next time the system sync's it starts at this old MIN_ACTIVE_ROWVERSION.
Sam
Here is what the row version is and why I believe the concept exists in Firebird:
SQL Server has a @@DBTS (DataBase TimeStamp), it is *NOT* a timestamp in the sense of time or date. It is simply a sequence number which each time there is an insert or an update to ANY table in the DB, this @@DBTS is increased by one. Microsoft also refers to this as the ROW VERSION.
Then Microsoft has this concept of the MIN_ACTIVE_ROWVERSION, which they state "The MIN_ACTIVE_ROWVERSION function returns the lowest active timestamp (also known as rowversion) value in the current database. A timestamp value is active when it is used in a transaction that has not yet been committed. If there are no active values in the database, MIN_ACTIVE_ROWVERSION returns the same value as @@DBTS + 1."
So the reason I believe Firebird has this concept somewhere is because it is only logical that the engine uses the same basic concept to allow a client to get commited data and not get uncommited.
All in all the reason I need this value is for the reasons stated in the Microsoft Sync Framework, you sync up to the MIN_ACTIVE_ROWVERSION as not to try to get any rows that are in an active transaction, then you record that value so that next time the system sync's it starts at this old MIN_ACTIVE_ROWVERSION.
Sam