JiwaCollectionItem<(Of <(<'T>)>)>..::..RowHash Property

RowHash of the item. Used for concurrency control.

Namespace:  JiwaFinancials.Jiwa.JiwaApplication
Assembly:  JiwaApplication (in JiwaApplication.dll)

Syntax


[BrowsableAttribute]
public virtual byte[] RowHash { get; set; }
<BrowsableAttribute> _
Public Overridable Property RowHash As Byte()
	Get
	Set
[BrowsableAttribute]
public:
virtual property array<unsigned char^>^ RowHash {
	array<unsigned char^>^ get ();
	void set (array<unsigned char^>^ value);
}

Field Value

A byte array representing a SQL timestamp value

Return Value

A byte array representing a SQL timestamp value

Remarks


Maps to a TimeStamp type column in the underlying table. This is typically used for concurreny control - if the value of the RowHash at the time of saving differs to the value at the time of reading, then some other process has altered the row data in the table.

Examples


Use the RowHash to enforce a high degree of integrity in concurrency control.
VB.NET
Sql = "UPDATE RA_RequestLines SET ItemNo = @ItemNo, Quantity = @Quantity WHERE RecID = @RecID AND RowHash = @RowHash"

   Using SQLCmd As SqlCommand = New SqlCommand(Sql, .SQLConnection, .SQLTransaction)
      SQLCmd.CommandTimeout = JiwaApplication.Manager.Instance.Database.DefaultCommandTimeout

      SQLParam = New SqlParameter("@RecID", System.Data.SqlDbType.Char)
      SQLParam.Value = RecID
      SQLCmd.Parameters.Add(SQLParam)

      SQLParam = New SqlParameter("@RowHash", System.Data.SqlDbType.Timestamp)
      SQLParam.Value = RowHash
      SQLCmd.Parameters.Add(SQLParam)

      SQLParam = New SqlParameter("@ItemNo", System.Data.SqlDbType.Int)
      SQLParam.Value = ItemNo
      SQLCmd.Parameters.Add(SQLParam)

      If SQLCmd.ExecuteNonQuery() = 0 Then
         Throw New JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ConcurrencyConflictException()
      End If
   End Using