connection

C# - Unexpected authentication method mysql_native_password exception

陌路散爱 提交于 2019-12-06 12:46:12
问题 I didn't see anything on this, but I've been trying for the longest time to get some practice with an SQL database. I tried MSSQL and was frustrated to no end, so I tried MySQL and got a bit further. The database seems to be up and running, and I even did a query to make a table. Although when trying to connect with Microsoft's C# Express edition I get the exception: "unexpected authentication method mysql_native_password" I know the password is correct. I'm even referencing MySQL.Data.dll.

Server detecting a client losing connection from the socket

大兔子大兔子 提交于 2019-12-06 12:46:02
问题 In Java, if I connect to a client to a server via a socket and the client has an exception which causes it to crash, is there any way the server can detect that the socket connection is lost. I assume one method would be have some sort of heartbeat polling the client, but is there a simpler/easier way? 回答1: There are a few ways, depending on what you consider to be a "crash". If the client process dies, the client OS will close the socket. The server can detect this by performing a read() ,

Nodejs - websocket-node module: How to make multi-client socket-server works?

五迷三道 提交于 2019-12-06 12:38:44
问题 I created a socket server using websocket module with this configuration taken from this example (with some changes): var WebSocketServer = require('websocket').server; var http = require('http'); var server = http.createServer(function(request, response) { console.log((new Date()) + ' Received request for ' + request.url); response.writeHead(404); response.end(); }); server.listen(5050, function() { console.log((new Date()) + ' Server is listening on port 5050'); }); wsServer = new

Mule - stop all flows from shutting down where MySQL connection in single flow fails

霸气de小男生 提交于 2019-12-06 12:19:05
问题 I have a Mule application with a number of flows all performing various operations. One of these flows connects to an external MySQL database to retrieve information. If the connection to this database fails, my Mule application fails to start and none of my other, non-erroneous, flows start. Is there a way I can configure Mule to revert to the exception strategy of the flow connecting to the external DB in the event that the connection fails or there is some other error so that all other

Releasing ActiveRecord connection before the end of a Sidekiq job

时间秒杀一切 提交于 2019-12-06 12:11:40
问题 This question deals with matters of performance and optimization with the way one can implement Sidekiq jobs. Suppose we have the following job workflow def perform # Step 1 do_things_with_activerecord_db_and_get_some_parameters() # Step 2 step2_perform_an_http_request_with_these_parameters_on_unreliable_server() end In the following case, an ActiveRecord connection is taken from the pool at Step 1, and will only be released by SideKiq after job has completed (or failed) by the ActiveRecord

PDO test if connected

China☆狼群 提交于 2019-12-06 11:56:34
I can't find an answer to this anywhere. Maybe its really simple I have my mysql PDO connection like this: try{ $DBH = new PDO("mysql:host=$db_hostname;dbname=$db_database", $db_username, $db_password); $DBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); } catch (PDOException $e){ echo $e->getMessage(); exit; } i want to just test if the connection worked, ie. if the password, username, databasename & hostname were spelled correctly. the try, throw just seems to pick up fundamental errors, like if the driver is spelt wrong. it doesnt throw an error if say the password is wrong.

Each request from user call a new getConnection()?

半城伤御伤魂 提交于 2019-12-06 11:22:58
The database connection is get like below public Connection getDBConection(){ Context context = new InitialContext(); DataSource dataSource = (javax.sql.DataSource) context.lookup("java:myDataSource"); Connection conn = dataSource.getConnection(); } For a userA, is each database request should call getDBConnection() once; but no need to control all request use the same connection? That is, if userA has three database request, then userA should call getDBConnection() three times, and call Connection.closed() after used in each request? If the userA call getDBConnection() three times (that is,

Error when edmx file is in a separate project

坚强是说给别人听的谎言 提交于 2019-12-06 11:21:38
I have problem that says The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid. My edmx file is in separate project, but that project has connection string in its app.config What could cause the problem? Make sure the app.config is in the project which is set to be the startup project. IF I understand correctly (I hope I do!): You have two projects: ApplicationServices (Startup Project) Web.config EntityContainer MyEdmx.edmx App.config When the project starts up, it reads from the web.config file. You need

Set credentials for Entity Framework in code, without using Integrated Security and only storing User ID in config file

旧街凉风 提交于 2019-12-06 11:10:43
So, I went to create an EDMX file today, and while going through the connection options the wizard asked if I wanted to "keep sensitive data out of the .config file and manually set it in code" this makes perfect sense to me (use my own encrypted "appsetting" for connection credentials). Now, I'm sitting here trying to find out how to specify the credentials to my Entity Framework classes. The only thing I can find is the db.Connection.ConnectionString property, but I'm not really sure what to do with it all it contains is name=MyDatabaseName . TL;DR -- How does one create and use hard-coded

javascript/dashcode: check for internet connection

纵然是瞬间 提交于 2019-12-06 10:41:32
i'm developing a widget that is fetching data from the internet via ajax and i want to provide a error message, if the widget cannot connect to the server. i'm doing the request with jquery's ajax object which provides a error callback function, but it's not called when there is no internet connection, only if the request is made but fails for other reasons. now how can i check if the computer is connected to the internet? Doug Neiner UPDATE : Since you are creating a Dashboard widget, I ran a number of tests. I found that the $.ajax call actually triggered an error when there was no internet