详细解决方案
could not execute query 错误
热度:409 发布时间:2016-05-01 22:51:33.0
系统框架用的是spring.net + nhibernate + iis host wcf
会偶发的出现 could not execute query 异常导致系统崩溃,跟map肯定没关系,因为我执行select getdate()一样挂。
wcf没问题,调用不操作数据库的方法都没事。
而且数据库本身应该也没问题,没有锁出现,也没有很多用户连接。
有时候过几分钟就自己恢复正常,不过多数时候都是杀掉wcf所在的w3wp.exe进程就好。
操作系统是win2008,数据库是sql2008.
实在是不知道从哪里下手,有人能给点建议不?
------最佳解决方案--------------------
先试着debug重现问题
推测是调用wcf时的错误,
重点调试wcf,可能出现了调用时不可用
------其他解决方案--------------------
是不是wcf调用sql的代码写法出现问题了,响应时间嫌长,看看有没有多余代码
------其他解决方案--------------------
但是当出现错误的时候wcf方法是可以调用的啊,只要此方法不涉及数据库操作,只有在调用跟数据库相关的方法才会挂。
------其他解决方案--------------------
我看了一下异常和堆栈信息
Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.
------其他解决方案--------------------
堆栈
StackTrace
at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffsetBytes, Array dst, Int32 dstOffsetBytes, Int32 byteCount)
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
at System.IO.TextWriter.WriteLine(String value)
at System.IO.TextWriter.SyncTextWriter.WriteLine(String value)
at NHibernate.AdoNet.AbstractBatcher.Prepare(IDbCommand cmd)
at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
会不会是线程安全的问题?
------其他解决方案--------------------
我在数据库操作的方法上加了锁,系统出错的频率好像降低了,但还是有发生,有人能给点一件么~
相关解决方案
- 大神们开始觅错啦!org.hibernate.exception.SQLGrammarException: could not execute query
- 小白Could not execute JDBC batch update解决办法
- hibernate中Query query=session.createQuery的有关问题
- fatal error; call to a member function query() on a non-object异常求回答啊 php+sqlite
- struts2中 super,super.execute();是什么意思,如何理解
- 高人求解,关于<sql:query>标签解决办法
- hibernate Query.createQuery(queryString).list();查询最大只有1000条数据,该怎么处理
- org.hibernate.exception.SQLGrammarException: could not execute query有关问题求解
- hibernate query.list() 不执行解决方法
- could not execute query 错误
- query 剔除模糊属性
- asp.net 中有没有相仿 execute "Response.Write 0" 这样的命令
- context.Server.Execute 施行跳转报错
- nhibernate [could not execute query]错误
- Could not execute CVTRES.EXE [跪求解决方案!]解决方法
- HttpServerUtility.Execute 的一个判断,该怎么解决
- 非常非常急敬请高手们帮忙!分在前两天都散光了!DB2数据库连接出现 SQL0666-Estimated query processing time 192 exceeds limit 30,该如何解决
- EXECUTE 后的事务计数指出缺少了 COMMIT 或 ROLLBACK TRANSACTION 语句。原计数 = 0,当前计数 = 1解决方法
- EXCEL VBA有没有类似vbs execute方法,小弟我写了个vbs程序,移植到VBA中"Execute s " 这句报错
- startserver失败cannot execute file RUN_SYBASE解决方法
- COBOL里头能不能用动态SQL EXECUTE
- COBOL里面能不能用动态SQL EXECUTE,该怎么解决
- 求 详解 xml/Query 的资料。解决方案
- 数据库报错:Lost connection to MySQL server during query,该怎么处理
- 数据库报错:Lost connection to MySQL server during query,该如何解决
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:该怎么处理
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:该如何解决
- Could not execute JDBC batch update异常如何解决啊
- 报错:Could not execute JDBC batch update
- MyEclipse+Hibernate连接MSSQL数据库总是could not execute query