如何使用version\timestamp进行并发控制
我映射文件如下:
<hibernate-mapping assembly="WindowsFormsApplication1" namespace="WindowsFormsApplication1" xmlns="urn:nhibernate-mapping-2.2">
<class table="PRODUCT" name="Product" dynamic-update="true" dynamic-insert="true" optimistic-lock="version">
<id name="ProId" column="PRO_ID" type="System.String" length="10" />
<version name="Version" column="VERSION" type="System.Int32" unsaved-value="0" />
<property name="ProName" column="PRO_NAME" type="System.String" not-null="true" length="20" />
<property name="ProPrice" column="PRO_PRICE" type="System.Decimal" not-null="true" length="126" />
<property name="ProTime" column="PRO_TIME" type="System.DateTime" not-null="false" length="6" />
</class>
</hibernate-mapping>执行修改后,数据库vession 字段不累加,请各路高手帮忙解决?
我映射文件如下:
<hibernate-mapping assembly="WindowsFormsApplication1" namespace="WindowsFormsApplication1" xmlns="urn:nhibernate-mapping-2.2">
<class table="PRODUCT" name="Product" dynamic-update="true" dynamic-insert="true" optimistic-lock="version">
<id name="ProId" column="PRO_ID" type="System.String" length="10" />
<version name="Version" column="VERSION" type="System.Int32" unsaved-value="0" />
<property name="ProName" column="PRO_NAME" type="System.String" not-null="true" length="20" />
<property name="ProPrice" column="PRO_PRICE" type="System.Decimal" not-null="true" length="126" />
<property name="ProTime" column="PRO_TIME" type="System.DateTime" not-null="false" length="6" />
</class>
</hibernate-mapping>执行修改后,数据库vession 字段不累加,请各路高手帮忙解决?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货