- 浏览: 1337100 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
kay11:
...
JAVA生成简单的随机字符串(a-zA-Z0-9) -
zhangliguoaccp:
您好关于登录页面的验验证码这块怎么解决的?还有登录成功后,跳转 ...
JAVA,模拟HTTP登录 -
107x:
不错,谢谢!
<c:foreach 循环 map -
wenjin:
不知楼主是不还在想请叫一下我自己开的Tomcat下载一个文件C ...
Android 下载文件及写入SD卡 -
zyywgf:
JSTL c标签,fn标签,fmt标签
Can't start a cloned connection while in manual transaction mode.错误的解决方案
- 博客分类:
- J2EE
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.setupImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.<init>(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.<init>(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.prepareStatement(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.prepareStatement(Unknown Source)
at com.capitel.telecom.tobacco.dao.TightsmokeDAO.insertTightsmokeInfo(TightsmokeDAO.java:57)
at com.capitel.telecom.tobacco.logic.DataMaintainManager.tightsmokeAdd(DataMaintainManager.java:616)
。。。。。。。。。。
上面是从mysql数据库升级到SQL Server数据库时,第一次报的错误
从网上找了一些解决方案,先PS在下面:
--------------------------------------------------------------------------------------------------------------------------------
解决方案:(1)
你在尝试打开一个克隆连接,有两种解决办法: 每个数据库的连接在执行完毕后,关闭,第二,在连接时,判断是否已经有连接存在,有则使用现成的连接。 数据库连接可以设置成一个常量,不需要到处定义。便于维护。
解决方案:(2)
你在DatabaseURL字符串中加入SelectMethod=Cursor;如下
jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=Partner;SelectMethod=Cursor;
--------------------------------------------------------------------------------------------------------------------------------
If you pass "SelectMethod=cursor" attribute in connectio url, will allow more than one active statement per connection." jdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;","user","pwd"The reason for this is;When SelectMethod is set to direct, SQL Server does not support multiple active statements on a single connection within a transaction; however, when auto-commit mode is enabled (the default), the Microsoft SQL Server JDBC driver provides the ability to have multiple JDBC statements open on a single JDBC connection. This is done by cloning physical SQL Server connections as needed. To avoid cloning physical SQL Server connections in this circumstance, you should create only one Statement, PreparedStatement, CallableStatement, or DatabaseMetaData object per JDBC Connection
object. Be sure to invoke the "close" methods on these objects when you are finished with them, that is, before creating another object of the types described.Sridhar PaladuguMicrosoft Developer SupportJDBC Webdata
--------------------------------------------------------------------------------------------------------------------------------
是因为commit设置为false了,查资料,对URL做修改:jdbc:microsoft:sqlserver://localhost:1433;user=test;password=secret;SelectMethod=cursor;问题解决。
---------------------------------------------感觉比较有理由的下面的这个说法------------------------------------------------
原因一般是当你在一个SQL SERVER的JDBC连接上执行多个STATEMENTS的操作,或者是手动事务状态(AutoCommit=false) 并且使用默认的模式. direct (SelectMethod=direct) 模式.
解决办法
当你使用手动事务模式时,必须把SelectMethod 属性的值设置为 Cursor, 或者是确保在你的连接只有一个STATEMENT操作。
修改url
加入SelectMethod=cursor即可
总结一下:
我也只在连接数据库的URL后面添加了一段SelectMethod=cursor;就可以正常使用了
发表评论
-
Spring 和JFreeChart 用出现Unable to validate using XSD
2012-08-09 17:31 1786错误显示: 信息: XML validation disab ... -
web.xml不认<taglib>解决办法:
2012-07-11 15:24 970在web.xml不认<taglib>解决办法: ... -
Portal服务器,Portlet容器,Portlet 的区别
2011-08-24 17:06 1667这里所说的Portal是指JCP-JSR168规范所描述的 ... -
AMF,RTMP,RTMPT,RTMPS(转)
2011-04-28 13:10 19301. AMF AMF(是Action Message F ... -
web.xml 中的listener,filter,servlet 加载顺序
2011-04-22 13:35 1106首先,加载顺序与它们 ... -
JDOM修改XML中指定节点的内容
2011-03-21 09:45 2192UpdateXML 写道 package com.util; ... -
SSH配置多个数据源
2011-01-18 16:35 9903SSH配置多个数据源 1. 编写hibernate的数据库配 ... -
SSH中调用存储过程
2010-12-29 08:46 5590SSH中调用带返回结果集的存储过程: public clas ... -
HibernateDaoSupport与JdbcDaoSupport总结
2010-12-28 13:56 1365Spring框架中Dao支持总结:Dao 的支持类可以有 ... -
DBCP,CP30及proxool连接池在spring+hibernate中的配置
2010-12-22 17:08 5937用spring默认的连接池性能效率不高, 如果数据库重启, 应 ... -
IP过滤DEMO
2010-11-01 15:59 1270import java.io.IOException; im ... -
FCKEditor Demo
2010-11-01 15:56 2005FCKEditor 的官方下载: http://source ... -
htmlunit带框架的简单处理测试demo
2010-07-07 14:58 3767package com.htmlunit.test; i ... -
模式在SSH中的简单举例
2010-05-17 14:37 1106闲着没事,瞎想,回想了几个简单的模式在SSH的应用。有不对的还 ... -
AspectJ入门 安装及简单使用
2010-05-15 19:20 7114一、下载安装 1. download http: ... -
org.apache.commons.lang.RandomStringUtils
2010-05-05 09:01 2027来自包:apache的commons-lang.jar包下载: ... -
spring字符集过滤器配置
2010-05-04 14:53 2638<!-- spring的字符集过滤器 --> ... -
Cannot instantiate abstract class or interface
2010-05-03 22:49 3972org.hibernate.InstantiationExce ... -
org.hibernate.hql.ast.QuerySyntaxException: ? is not mapped
2010-05-03 21:52 41502010-5-3 21:48:23 org.apache.ca ... -
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit
2010-05-03 21:32 4205MyEclipse 开发 SSH 整合时 java.la ...
相关推荐
例如,在手动事务模式下尝试克隆连接可能会导致异常,如文中提到的“Can't start a cloned connection while in manual transaction mode”。 - **问题原因**:在手动事务模式下,如果尝试克隆连接,会导致这种类型...
- FIX: In "Windows ClearType" font rendering mode (OS Windows mode) the "garbage" pixels can appear from the right and from the bottom sides of the painted rectangle of the TFlexText object....
DataCloneError(解决方案)
a._setPaused=function(a){return createjs.Tween._register(this,a),this},a.setPaused=createjs.deprecate(a._setPaused,"AbstractTween.setPaused"),a._getPaused=function(){return this._paused},a.getPaused=...
Ghost Software and Altiris to develop programs that can change a computer‘s SID after a system has been cloned. However, PowerQuest‘s SID Changer and Ghost Software‘s Ghost Walker are only sold as...
Removing Credentials from a Cloned EBS Production Database (Doc ID 419475.1)
A paper published in 2016. ABSTRACT Assembly code analysis is one of the critical processes for detecting and proving software plagiarism and software patent infringements when the source code is ...
and supersedes information contained in otherdocuments, including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized ...
In a web application, for instance, having a singleton database connection manager can help manage and control connections efficiently, ensuring that there's only one central authority for managing ...
SA0033310 - Cloned connections don't always work correctly. SA0033327 - $$...$$ macro usage with SQL Server environments, in certain cases may trigger multiple executions of the same macro. SA...
RFID(射频识别)技术是无线通讯技术的一种,它可以用于追踪和识别物理对象。...这些方向的研究将有助于开发出更全面、更鲁棒的RFID克隆标签检测解决方案,为各种需要RFID技术的应用提供更高级别的安全保障。
- **Clone Types:** Types that implement the `Clone` trait can be cloned, creating a new owned value. - **Copy Types:** Types that implement the `Copy` trait can be copied directly into another ...
这些初创公司通过创新的解决方案和商业模式吸引了大量的风险资本,预示着未来科技行业的繁荣和潜力。同时,投资者对这些初创公司的投资反映了他们对新兴技术和创新业务模式的信任,以及对未来的乐观预期。
3. Run npm install in cloned directory 4. Start MongoDB service in your machine 5. Change the connection string of DB in db/db.js 5. Start the app by running npm run dev and open POSTMAN. 6. Start ...
What is HoloIRC? HoloIRC is an open source IRC client for Android....A directory called libraries should be created inside the cloned folder https://github.com/tilal6991/Relay should be cloned into a f
goto(a)},b.getLabels=function(){return this.timeline.getLabels()},b.getCurrentLabel=function(){return this._updateTimeline(),this.timeline.getCurrentLabel()},b.clone=function(){throw"MovieClip cannot ...
in text file (assembly language source) into a machine executable object file. During the first pass, the assembler builds a symbol table from the symbols and labels used in the source file. In the ...
The text caret is placed in the correct location after accepting a .NET Generic from a suggestion list in VB 2008. (case=20259) 8257 When typing a parameter in a C# LINQ predicate function, focus is ...
in text file (assembly language source) into a machine executable object file. During the first pass, the assembler builds a symbol table from the symbols and labels used in the source file. In the ...
LFS是Large File Storage的缩写,用了帮助git管理大的文件 原理:不同于git每次保存diff,对于git来说,如果是模型或者一些设计大文件,改变一点,对于仓库来说会增加很大的体积,不一会就能几个G。...