- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 ColdFusion 9 和 MS SQL Server。
我正在尝试使用:
<cftransaction isolation="read_uncommitted">
<cfset X = EntityLoad('table',row_id,true)>
</cftransaction>
09:20:32.688)>> Connection[6].prepareStatement(String sql)
09:20:32.688)>> sql = select ..... _ID=?
09:20:32.688)>> OK (PreparedStatement[871])
09:20:32.689)>> PreparedStatement[871].executeQuery()
09:20:33.594)>> OK (ResultSet[989])
09:20:33.606)>> Connection[6].setTransactionIsolation(int level)
09:20:33.606)>> level = 1
09:20:33.962)>> OK
09:20:34.141)>> Connection[6].setTransactionIsolation(int level)
09:20:34.141)>> level = 2
09:20:34.501)>> OK
09:24:30.164)>> Connection[6].setTransactionIsolation(int level)
09:24:30.164)>> level = 1
09:24:30.519)>> OK
09:24:30.519)>> Statement[37].execute(String sql, int autoGeneratedKeys)
09:24:30.519)>> sql = select ...
09:24:30.519)>> autoGeneratedKeys = 1
09:24:30.699)>> OK (true)
09:24:30.879)>> Connection[6].setTransactionIsolation(int level)
09:24:30.879)>> level = 2
09:24:31.234)>> OK
最佳答案
我在 Curt Gratz 的 ColdBox 博客上找到了一篇关于此的帖子:Coldfusion ORM - Transaction Isolation Level...完整阅读那篇文章,它有一些优点。但基本上 Curt 发现你可以创建一个自定义的休眠配置文件来指定各种设置。
来自那篇博文:
So, since changing the isolation level isn't one of the settings available in the ormsettings, I had to create a custom hibernate config file.
At first I thought this would be difficult as I thought that I would have to insert all the "standard" settings the Coldfusion implementation of hibernate was already using, but it turns out, you only have to set any additional properties you wish to use. Here is a list of available hibernate configuration options.
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html
So, on to some code...
Here is my newly created hibernate config file.
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory
name="java:hibernate/SessionFactory">
<!-- properties -->
<property name="connection.isolation">1</property>
</session-factory>
</hibernate-configuration>Notice one thing in the config file.
<property name="connection.isolation">1</property>
. Why one you ask...Here is the int values for each of the isolation levels available.
java.sql.Connection
public static final int TRANSACTION_NONE 0
public static final int TRANSACTION_READ_COMMITTED 2
public static final int TRANSACTION_READ_UNCOMMITTED 1
public static final int TRANSACTION_REPEATABLE_READ 4
public static final int TRANSACTION_SERIALIZABLE 8Then in my application.cfc I set
<cfset this.ormsettings = {dialect="MicrosoftSQLServer", ormconfig="hibernate.xml"}>
Now, be sure that you have your hibernate.xml file somewhere outside of webroot to protect it from being read by any evil eyes.
There you go, hope this helps you as it took me a lot of digging to figure it out
关于sql-server - 使用 CFTRANSACTION 和 ORM EntityLoad 设置隔离级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33234024/
我如何在 ColdFusion 中将 <= 添加到我的过滤条件中。我正在尝试这个 EntityLoad("Entity",{someProperty <= value}); 但没有运气 最佳答案 使用
我有一张包含事件的表。我正在尝试显示 future 所有事件的列表。我正在使用 orm,但我无法弄清楚如何选择 future 的日期。过滤器仅接受“=”而不接受“>”。我目前有这个,但显然不起作用:
我刚刚开始使用 CF9 的 ORM 功能,遇到了一个问题。 我设置了一个表 - 成员 - 其中有 2 条记录。 如果我尝试: members = EntityLoad("member"); writ
我有一个在开发服务器上运行良好的 orm 应用程序。当将代码带到生产环境、重建表并尝试访问具有过滤条件的 entityLoad 页面时,我得到一个没有错误的空白页面。查看日志后,真正的错误出现了。 这
我正在尝试做一些我认为非常基本的事情,但我无法让它发挥作用。我这样调用 EntityLoad: transaction { dataLoad = EntityLoad("tran
我正在使用 ColdFusion 9 和 MS SQL Server。 我正在尝试使用: 更改某些事务中的隔离级别 但是从数据源查看日志我得到了这个: 09:20:32.688)>> Co
我有3张 table 用户 users_pk 用户名 用户设置 users_settings_pk users_fk settings_fk 值(value) 设置 settings_pk 设置名称
我正在 Coldfusion 2016 上构建一个 Web 应用程序,到目前为止一切正常,但是当我使用EntityLoad并尝试使用 getAdminID() 方法检索 adminID 时,我收到一条
我是一名优秀的程序员,十分优秀!