MySQL Workbench drops connection when idle

Go to Edit -> Preferences -> SQL Editor and there you’ll see: DBMS connection keep-alive interval (in seconds): 600 DBMS connection read time out (in seconds): 600 DBMS connection time out (in seconds): 60 The DBMS connection keep-alive interval means how often Workbench sends keep-alive request to the server to keep the connection alive. Since … Read more

Keep SSH session alive while computer sleep? [closed]

I found the answer it depends on tcp keepalive settings: For the list of available TCP settings (FreeBSD 4.8 an up and 5.4): sysctl -A | grep net.inet.tcp net.inet.tcp.keepidle – Amount of time, in milliseconds, that the (TCP) connection must be idle before keepalive probes (if enabled) are sent. net.inet.tcp.keepintvl – The interval, in milliseconds, … Read more

psql set default statement_timeout as a user in postgres

You could use your .psqlrc file (if you don’t have one in your home directory, create it; if you’re on Windows instead of *nix, the file is %APPDATA%\postgresql\psqlrc.conf instead) and set the following command: set statement_timeout to 60000; commit; That setting is in milliseconds, so that’ll set the timeout to 1 minute. .psqlrc isn’t used … Read more

RestSharp Timeout not working

Solution (Version 107+) var options = new RestClientOptions(“baseURL”) { ThrowOnAnyError = true, Timeout = 1000 // 1 second – thanks to @JohnMc }; var client = new RestClient(options); Older Versions: to alter the default time out to: 5 seconds – for example – (i.e. 5000 milliseconds): var client = new RestClient(“BaseUrl”); client.Timeout = 5000; // … Read more

Timeout an async method implemented with TaskCompletionSource

You could use CancellationTokenSource with timeout. Use it together with your TaskCompletionSource like this. E.g.: public Task<OpResult> BlackBoxOperationAysnc() { var tcs = new TaskCompletionSource<TestResult>(); const int timeoutMs = 20000; var ct = new CancellationTokenSource(timeoutMs); ct.Token.Register(() => tcs.TrySetCanceled(), useSynchronizationContext: false); EventHandler<EndOpEventArgs> eventHandler = (sender, args) => { … tcs.TrySetResult(OpResult.BlarBlar); } blackBox.EndAsyncOpEvent += eventHandler; blackBox.StartAsyncOp(); return tcs.Task; … Read more

Why does autoReconnect=true not seem to work?

I had the same issue and it was absolutely maddening. Here’s what the docs say on the MySQL website (emphasis mine) Should the driver try to re-establish stale and/or dead connections? If enabled the driver will throw an exception for a queries issued on a stale or dead connection, which belong to the current transaction, … Read more

Help troubleshooting SqlException: Timeout expired on connection, in a non-load situation

Not Enough Memory This is very likely a Memory problem, perhaps aggravated or triggered by other things, but still inherently a memory problem. there are two other (less likely) possibilities, that you should check and eliminate first (because it is easy to do so): Easy To Check Possibilities: You may have “Auto Close” enabled: Auto … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)