timeout

.NET: SqlDataReader.Close or .Dispose results in Timeout Expired exception

喜夏-厌秋 提交于 2019-12-23 10:57:41
问题 When trying to call Close or Dispose on an SqlDataReader i get a timeout expired exception. If you have a DbConnection to SQL Server, you can reproduce it yourself with: String CRLF = "\r\n"; String sql = "SELECT * " + CRLF + "FROM (" + CRLF + " SELECT (a.Number * 256) + b.Number AS Number" + CRLF + " FROM master..spt_values a," + CRLF + " master..spt_values b" + CRLF + " WHERE a.Type = 'p'" + CRLF + " AND b.Type = 'p') Numbers1" + CRLF + " FULL OUTER JOIN (" + CRLF + " SELECT (print("code

Managing the running time of background jobs. Timing out if not completed after x seconds,

[亡魂溺海] 提交于 2019-12-23 10:20:00
问题 I would like to time my background jobs (started with start-job ) and time them out after x seconds. I find it hard however to keep track of the running time on each separate job (I am running aprox 400 jobs). I wish there was a way to time out the job and set it to failed if not completed in X seconds, but I find no timeout-parameter. What would be a good way to track the individual run-time of the jobs? I guess I could create a hashtable with start-time of each job and the job-id and check

How to combine timeout and eval commands in bash

送分小仙女□ 提交于 2019-12-23 09:57:30
问题 For executing command that is stored in variable the eval command is used: └──> a="echo -e 'a\nb' | wc -l" └──> eval $a 2 But how can it be combined with timeout command? I've tried following which gives me wrong output: └──> timeout 10 $a 'a b' | wc -l And the following which gives me errors: └──> timeout 10 "$a" timeout: failed to run command `echo -e \'a\\nb\' | wc -l': No such file or directory └──> timeout 10 $(eval $a) timeout: failed to run command `2': No such file or directory └──>

windows batch scripting: catch user reaction to “timeout” command

核能气质少年 提交于 2019-12-23 09:39:21
问题 I know that by using the "timeout" command, I can wait for specified amount of time; but my question is that what if this would be an automatic operation that could be prevented by user? I mean suppose that I wanted to do the operation A but by using the "timeout" command I wait if user wants to cancel this operation or not; for example during this waiting process if user pressed the Enter key then batch script execute something else(not operation A); 回答1: timeout is just to induce a delay

Timing out a multiprocessing function

放肆的年华 提交于 2019-12-23 09:33:04
问题 I need to set a time limit on a python function which use some multiprocessing stuff (I don't know if it matters). Something like this: function(a_list): p1 = Process(a_list[0:len(a_list/2)]) p2 = Process(a_list[len(a_list)/2: len(a_list)]) //start and join p1, p2 I look around the net and I found a time out decorator but it looks quite tricky and verbose (I'm newbie on decorators). What I'd want is a simple thing. EDIT: I think I made it too simple. My program iterates over the above

Can it be acceptable in Java to use Thread#stop() to kill a thread that is running wild?

久未见 提交于 2019-12-23 09:29:15
问题 Regrettably there is no way to specify a timeout when using a regular expression on a String in Java. So if you have no strict control over what patterns get applied to which input, you might end up having threads that consume a lot of CPU while endlessly trying to match (not so well designed) patterns to (malicious?) input. I'm aware of the reasons why Thread#stop() is deprecated (see http://download.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html). They are centered

MySql JDBC timeout even with 'autoReconnect=true' [duplicate]

若如初见. 提交于 2019-12-23 09:18:18
问题 This question already has answers here : Why does autoReconnect=true not seem to work? (2 answers) Closed last year . Occasionally, my Java/Tomcat6/Debian Squeeze application can't talk to the MySql server. The Tomcat application is on a front-end server and MySql is on a separate, MySql-only box. A typical error is: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was56588 milliseconds ago. The last packet sent successfully to the

Rx Framework: execute an action on timeout without interrupting the original observable sequence

拟墨画扇 提交于 2019-12-23 08:06:10
问题 Given an observable source, generated by polling the (changes of a) state of a low-level device... // observable source metacode: IObservable<DeviceState> source = Observable.Interval(TimeSpan.FromSeconds(0.5)) .Select(tick => new DeviceState(_device.ReadValue())) .DistinctUntilChanged(); ... and a consumer that updates the UI... // UI metacode: service.GetObservableDeviceStates() .Subscribe(state => viewModel.CurrentState = state.ToString()); ... I need to execute a custom action after x

Smack 4.1 No Response within reply timeout

梦想与她 提交于 2019-12-23 07:47:34
问题 I am using the following code in my android app: Thread d = new Thread(new Runnable() { @Override public void run() { SmackConfiguration.setDefaultPacketReplyTimeout(10000); XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder() .setUsernameAndPassword("admin", "password") .setServiceName("192.168.0.200") .setHost("192.168.0.200") .setPort(5223).setSecurityMode(SecurityMode.ifpossible) .build(); AbstractXMPPConnection conn2 = new XMPPTCPConnection(config); try {

Why “TransactionReaper::check timeout for TX” warning in JBoss server.log

给你一囗甜甜゛ 提交于 2019-12-23 07:33:38
问题 I am using Hibernate 3.6.0 with JBoss 6.0-Final release and my Database is MS-SQL Server 2008 . I have to fetch employee data from LDAP server and insert those into database - the count of LDAP entries are 180,000 or more. I am using bean managed transaction because using CMT my transaction never gets committed (because of high volumn of insert). The logic is: in a while-loop I am keep on fetching & creating entries in database using JPA (Hibernate). Thus I am having a long series of fetch