NHibernate SetTimeout关于标准 [英] NHibernate SetTimeout on ICriteria

查看:107
本文介绍了NHibernate SetTimeout关于标准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我ICriteria界面中SetTimeout(int)方法使用的单位吗?
是毫秒,秒,分钟还是其他时间?

Could someone tell me what the units the SetTimeout(int) method in the ICriteria interface uses?
Is it milliseconds, seconds, minutes or other?

推荐答案

稍微戳一下,可能会是几秒钟:

A little bit of poking around suggests that it could be seconds:

假设ICriteria与Hibernate核心中的Criteria接口相同,则

Assuming that ICriteria is the same as the Criteria interface in Hibernate core, then the JavaDoc for org.hibernate.Criteria provides a hint - the "see also" link to java.sql.Statement.setQueryTimeout(). The latter refers to its timeout parameter as seconds.

假设NHibernate实现遵循该方法的隐含约定,则应该可以.但是,为了省心,我去找了一些NHibernate特定的东西.有许多对CommandTimeout的引用.例如,与NHibernate相关的此处.果然, CommandTimeout文档指出它是秒.

Assuming that the NHibernate implementation follows the implied contract of that method, then that should be fine. However, for peace of mind's sake, I went and looked for some NHibernate specific stuff. There are various references to CommandTimeout; for example, here, related to NHibernate. Sure enough, the documentation for CommandTimeout states that it's seconds.

我几乎没有发布以上内容,因为我不完全知道答案,也找不到任何具体的文档-但是由于问题很少,我认为呈现现在不会有任何伤害这些发现.

I almost didn't post the above, because I don't know the answer outright, and can't find any concrete documentation - but since there is so little on the issue, I figured it couldn't hurt to present these findings.

这篇关于NHibernate SetTimeout关于标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆