配置 hilo“无法获取或更新下一个值[SQL:]”
我想将 NHibernate 配置为使用 hilo 生成器,但以下配置会引发 GenericADO 异常,提示“无法获取或更新下一个值 [SQL: ]”。如果生成器类是“identity”,它将按预期工作。
笔记。使用 hilo 生成器时,我在 SQL Server 端将“Is Identity”设置为“No”。
<class name="Model.Session, Domain" table="Session">
<id name="SessionID" column="SessionId" type="Int32">
<!--<generator class="identity" />-->
<generator class="hilo" /
</id>
<property name="SessionToken" column="SessionToken" type="String" length="80"/>
<property name="UserID" column="UserId" type="Int32"/>
</class>
I want to configure NHibernate to with hilo generator, but the following configuration throws a GenericADO exception saying "could not get or update next value[SQL: ]". If the generator class is 'identity' it works as expected.
Note. I set the "Is Identity" to 'No' on the SQL Server end when using the hilo generator.
<class name="Model.Session, Domain" table="Session">
<id name="SessionID" column="SessionId" type="Int32">
<!--<generator class="identity" />-->
<generator class="hilo" /
</id>
<property name="SessionToken" column="SessionToken" type="String" length="80"/>
<property name="UserID" column="UserId" type="Int32"/>
</class>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NHibernate 用于从服务器获取“低”值的表可能尚未手动或通过模式生成创建。
Probably the table that NHibernate uses to get the "low" values from the server has not been created, either manually or by schema generation.