我正在利用魔力jQuery.ajax( settings ).
但是,我想知道是否有人玩超时设置多吗?
我知道它基本上用于指示请求的本地时间,但如果达到超时,它是否可以触发任何内容?或者它只是停止听取回应?
阅读jQuery网站,我可以看到没有传递任何参数,所以它看起来像是一个具有一个功能的简单设置.哪个好.
但是,如果达到超时,我想触发警报或某些功能.在这种情况下,我可以看到错误设置没有被触发.
这是我的片段:
$("form#testform").submit(function(){
var allFormValues = $("form#testform").serialize();
$.ajax({
cache:false,
timeout:8000, // I chose 8 secs for kicks
type:"POST",
url:"someurl.php",
data:allFormValues,
error:function(){ alert("some error occurred") },
success:function(response){ alert(response); }
});
});
Run Code Online (Sandbox Code Playgroud)
有谁知道如何使用超时工作更多?
我的命令保持超时,所以我需要更改默认命令超时值.
我发现了myDb.Database.Connection.ConnectionTimeout,但它确实如此readonly.
如何在Entity Framework 5中设置命令超时?
错误代码:2013.查询期间与MySQL服务器的连接丢失
我正在使用MySQL Workbench.此外,我正在运行一批插入,总共大约1000行(例如,INSERT INTO mytable SELECT * FROM mysource1; INSERT INTO mytable SELECT * FROM mysource2;...mysource3...mysource4乘以1000倍)每批需要相当长的时间,其中一些,超过600秒.
如何配置工作台,继续工作一夜之间,不停止而不丢失连接?
在服务器回答请求之前,浏览器在显示错误之前等待多长时间?这次可以无限制吗?
我有一点问题,希望有人可以给我一些建议.我正在运行一个SQL命令,但它似乎需要这个命令大约2分钟才能返回数据,因为有很多数据.但是默认连接时间是30秒,如何增加它,并将其应用于此命令?
public static DataTable runtotals(string AssetNumberV, string AssetNumber1V)
{
DataTable dtGetruntotals;
try
{
dtGetruntotals = new DataTable("Getruntotals");
//SqlParameter AssetNumber = new SqlParameter("@AssetNumber", SqlDbType.VarChar, 6);
//AssetNumber.Value = AssetNumberV;
SqlParameter AssetNumber = new SqlParameter("@AssetNumber", SqlDbType.VarChar, 10);
AssetNumber.Value = AssetNumberV;
SqlParameter AssetNumber1 = new SqlParameter("@AssetNumber1", SqlDbType.VarChar, 10);
AssetNumber1.Value = AssetNumber1V;
SqlCommand scGetruntotals = new SqlCommand("EXEC spRunTotals @AssetNumber,@AssetNumber1 ", DataAccess.AssetConnection);
// scGetruntotals.Parameters.Add(AssetNumber);
scGetruntotals.Parameters.Add(AssetNumber);
scGetruntotals.Parameters.Add(AssetNumber1);
SqlDataAdapter sdaGetruntotals = new SqlDataAdapter();
sdaGetruntotals.SelectCommand = scGetruntotals;
sdaGetruntotals.Fill(dtGetruntotals);
return dtGetruntotals;
}
catch (Exception ex)
{
MessageBox.Show("Error Retriving totals Details: …Run Code Online (Sandbox Code Playgroud) 我从错误消息中读到了这个建议:
您应该考虑在应用程序中使用之前过期和/或测试连接有效性,增加服务器配置的客户端超时值,或使用Connector/J连接属性"autoReconnect = true"来避免此问题.
我正在使用Spring和JPA.我应该在哪里配置Connector/J?(在弹簧配置中persistence.xml,或在entityManagerFactory弹簧配置中,或在dateSource其他地方?)
RequestQueue mRequestQueue = Volley.newRequestQueue(getApplicationContext());
mRequestQueue.add(new JsonObjectRequest(Method.GET, cityListUrl, null, new Listener<JSONObject>()
{
public void onResponse(JSONObject jsonResults)
{
//Any Call
}
}, new ErrorListener()
{
public void onErrorResponse(VolleyError arg0)
{
//Any Error log
}
}
));
Run Code Online (Sandbox Code Playgroud)
这是我的请求调用,我想更改或设置请求的超时.反正有可能吗?
我有以下设置:
final OkHttpClient okHttpClient = new OkHttpClient();
okHttpClient.setReadTimeout(5, TimeUnit.SECONDS);
okHttpClient.setConnectTimeout(5, TimeUnit.SECONDS);
RestAdapter.Builder builder = new RestAdapter.Builder()
.setEndpoint(ROOT)
.setClient(new OkClient(okHttpClient))
.setLogLevel(RestAdapter.LogLevel.FULL);
Run Code Online (Sandbox Code Playgroud)
我试图处理我的服务器关闭和用户获得连接超时异常的情况,这是我的日志记录:
java.net.SocketTimeoutException: failed to connect to /192.168.0.53 (port 3000) after 5000ms
Run Code Online (Sandbox Code Playgroud)
完整日志记录:http://pastebin.com/gscCGb7x
有没有办法将其转换为改装故障方法,以便我可以在那里处理它?
提前致谢!
我有Python Django应用程序的Nginx + uWSGI.
我有以下内容nginx.conf:
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9001;
uwsgi_read_timeout 1800;
uwsgi_send_timeout 300;
client_header_timeout 300;
proxy_read_timeout 300;
index index.html index.htm;
}
Run Code Online (Sandbox Code Playgroud)
但是对于uWSGI上长时间运行的请求大约需要1分钟才能完成,我在Nginx错误日志中会出现超时错误,如下所示:
2013/04/22 12:35:56 [错误] 2709#0:*1上游超时(110:连接超时)从上游读取响应头,客户端:xx.xx.xx.xx,server :, request :"GET/entity/datasenders/HTTP/1.1",上游:"uwsgi://127.0.0.1:9001",主机:"xxx.xx.xx.x"
我已经设置了标头超时和uWSGI发送/读取超时到5分钟,有人可以告诉我我能做些什么来克服这个问题?
我尝试通过REST发送请求.我在使用firefox rest-client时得到了成功的响应,但是在SoapUI中我得到了下面的异常.如何解决这个问题?谢谢.
java.net.ConnectException:连接超时:在java.net.PlainSocketImpl.socketConnect(本机方法)在java.net.PlainSocketImpl.doConnect(来源不明)在java.net.PlainSocketImpl.connectToAddress(来源不明)在Java的连接. net.PlainSocketImpl.connect(未知来源)在java.net.SocksSocketImpl.connect(未知来源)在java.net.Socket.connect(未知来源)在java.net.Socket.connect(未知来源)在java.net.插座.(来源不明)在java.net.Socket中.(来源不明)在org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)在org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory .createSocket(DefaultProtocolSocketFactory.java:122)在org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)在com.eviware.soapui.impl.wsdl.support.http.SoapUIMultiThreadedHttpConnectionManager $ HttpConnectionAdapter.open(SoapUIMultiThreadedHttpConnectionManager .java:1637)在org.apache.commons 位于org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)的.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) )在com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:202)在com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)在java.util.concurrent.Executors $ RunnableAdapter.call(来源不明)在java.util.concurrent.FutureTask中$ Sync.innerRun(来源不明)在java.util.concurrent.FutureTask.run(来源不明)在java.util中. concurrent.ThreadPoolExecutor $ Worker.runTask(来源不明)在java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(来源不明)在java.lang.Thread.run(来源不明)