我的世界联机版lost connection: disconnect.endOfStream

数据库报错:Lost connection to MySQL server during query
[问题点数:40分,结帖人goen123]
数据库报错:Lost connection to MySQL server during query
[问题点数:40分,结帖人goen123]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
相关帖子推荐:
2012年 总版技术专家分年内排行榜第一2007年 总版技术专家分年内排行榜第二2006年 总版技术专家分年内排行榜第二2004年 总版技术专家分年内排行榜第二
2005年 总版技术专家分年内排行榜第三2003年 总版技术专家分年内排行榜第三2002年 总版技术专家分年内排行榜第三
本帖子已过去太久远了,不再提供回复功能。Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
I have a .Net service that connects to an Oracle database on every request. It works fine at the beginning, but after some number of requests I start getting:
Oracle.DataAccess.Client.OracleException ORA-03135: connection lost contact
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
at Oracle.DataAccess.Client.OracleCommand.ExecuteReader()
at MyApp.Services.OracleConnectionWithRetry.ExecuteReader(OracleCommand command)
Any idea what might be the problem? I dispose all the connections, results and parameters. The load on this service is, well, very low.
17.5k1676145
It happens because your code requests a connection from the Oracle Connection Pool and the connection pool returns a disconnected / stale connection to the Oracle DB. ODP.NET does not itself test the connection status of the connection sent to client.
So to be safe, either you check the connection status
== Open for the connection received from the pool when you do a Connection.Open()
let ODP.NET do the checking for you by setting Validate Connection = true in your connection string in web.config.
Both this methods have a impact on performance as they test the connection status each time you need to connect to the database.
A third option which I use is use of exceptions. First be optimistic and use whateven connection is returned from the connection pool. If you get a ORA - 3135 then request a new connection and execute your query again like a while loop. In best case, you can get your 1st connection as valid and your query will execute. In worst case, all the connections in your pool are stale in which case the code will be executed N time (where N is the connection pool size).
Did you find this question interesting? Try our newsletter
Sign up for our newsletter and get our top new questions delivered to your inbox ().
Subscribed!
Success! Please click the link in the confirmation email to activate your subscription.
try turning off connection pooling with "Pooling=false" in the connection string. I have a theory that idle connections in the pool expire, but ODP.NET does not realize that they have expired, and then when your app grabs one and tries to do something you get that exception.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Top questions and answers
Important announcements
Unanswered questions
By subscribing, you agree to the
Stack Overflow works best with JavaScript enabled极品飞车8局域网联机可以看见主机,但是进大厅的时候说you have lost connection to EA sever_百度知道
极品飞车8局域网联机可以看见主机,但是进大厅的时候说you have lost connection to EA sever
但是进入大厅的时候说 lost connection to EA sever ,其他人只能看见主机,防火墙都关了,check connection之类的话。都是win7系统我和宿舍其中一个人版本不一样,是直接复制整个安装好的游戏传的就能联
但相同方法传给其他朋友其只能看见主机,防火墙都关了,但是进入大厅的时候说 lost connection to EA sever ,check connection之类的话。都是win7系统我和宿舍其中一个人是直接复制整个安装好的游戏传的就能联
我有更好的答案
按默认排序
仅适用于多机局域网连接超慢,房东劝你还是不要尝试,如果你必须以必要的互联网在线(网络)补丁!听我的权利
你们的网线是怎么个情况是局域网啊还是网线直接连的.如果是话在你们的局域网里点共享.
用的是宿舍的无线路由
无限路由的话你们连接的完之后局域网里都会有编号,你们都能看到自己的主机编号么?
主机建立之后可以看到主机,然后进入大厅lobby的时候进不去了
你们的无限路由没毛病吧.如果不行的话你们可以互相建立一下主机.看谁的可以看到编号
嗯,也试过了,谢谢你这么不嫌麻烦哦
不客气,以前在寝室也出个这个毛病,换了个新的就好了,以前找过原因,去问卖路由器的人说是路由器上的编号问题.呵呵
其他类似问题
极品飞车8的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 我的世界手机版联机 的文章

 

随机推荐