connection

Running out of DB connections!

夙愿已清 提交于 2019-12-03 09:32:59
问题 I'm running a Spring/Hibernate connecting to MySQL setup using c3p0 as my connection pool. For some bizarre reason it runs out of connections when the system is under load (of course). The site was pretty stable until we started hitting a new level of traffic (over a hundred concurrent users). At that point the DB would melt down (peg the CPU). My first action was in the application to improve performance through extensive caching and optimization of queries etc. Now it will just run out of

try to understand mysql concepts: session v.s. connection

牧云@^-^@ 提交于 2019-12-03 08:35:56
问题 I'm a bit confused by mysql concepts: session vs connection. When we are talking about connecting to mysql. We use connection terminology, as well as connection pool and etc. However let's go to mysql online doc: http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html. It talks about session variables. They are quite similar. How to distinguish them? Thanks in advance. 回答1: A session is just a result of a successful connection . Any MySQL client requires some connection settings

Magento db connection parameters won't change, crazy caching?

↘锁芯ラ 提交于 2019-12-03 08:24:40
I have copied our entire www directory from our web server to my local workstation. I am trying to get Magento to connect to a local database. Yes, I changed the connection string values in the 'magento/app/etc/local.xml' file. I have verified about a hundred times that it has been changed. And before you tell me that it is cached, I have deleted the entire 'magento/var/cache' directory, just to be safe, and grepped all files in the www directory for our 'secret_password'. Below is an excerpt from my local.xml file. <host><![CDATA[localhost]]></host> <username><![CDATA[root]]></username>

Java JDBC efficiency: How long should a connection be maintained?

痴心易碎 提交于 2019-12-03 08:10:20
I'm still working on the same problem mention here . It seems to work fine especially after creating an AbstractModel class shown below: public abstract class AbstractModel { protected static Connection myConnection = SingletonConnection.instance().establishConnection(); protected static Statement stmt; protected static ResultSet rs; protected boolean loginCheck; // if userId and userLoginHistoryId are valid - true, else false protected boolean userLoggedIn; // if user is already logged in - true, else false public AbstractModel (int userId, Long userLoginHistoryId){ createConnection(); //

Check internet connection on iOS app with Cordova Phonegap 3.3.0 not working

流过昼夜 提交于 2019-12-03 07:48:45
问题 I have tried following this guide on Cordova docs, but it doesn't seem to work. Here is my code: I have added <plugin name="NetworkStatus" value="CDVConnection" /> to config.xml . and this script to my index.html : <script type="text/javascript"> document.addEventListener("deviceready", onDeviceReady, false); // device APIs are available // function onDeviceReady() { alert("1"); // runs this alert checkConnection(); } function checkConnection() { var networkState = Connection.CELL; alert("2")

Exceptions, and how best to retry when a connection is reset?

偶尔善良 提交于 2019-12-03 06:56:18
I have some code which connects to a URL to download a file, and then performs some processing on it. However, sometimes I am receiving the error java.net.SocketException: Connection reset . I would like to retry to download the file when I receive this error, say a maximum of 3 times before giving up on it. I would like to know what would be the best way to structure this. Does the following look ok. Does it seem acceptable to place the try-catch block inside of a while loop, or is there a better approach? All help is much appreciated! while(!connected && retries > 0) { retries--; URL

SQL Server to MySQL data transfer

浪尽此生 提交于 2019-12-03 06:39:54
I am trying to transfer bulk data on a constant and continuous based from a SQL Server database to a MYSQL database. I wanted to use SQL Server's SSMS's replication but this apparently is only for SQL Server to Oracle or IBM DB2 connection. Currently we are using SSIS to transform data and push it to a temporary location at the MYSQL database where it is copied over. I would like the fastest way to transfer data and am complication several methods. I have a new way I plan on transforming the data which I am sure will solve most time issues but I want to make sure we do not run into time

Running EC2 instance suddenly refuses SSH connection

耗尽温柔 提交于 2019-12-03 06:38:29
问题 I've set up the EC2 instance couple days ago and even last night I was able to SSH to it with no problems. Today morning, I can't ssh to it. Port 22 is already open in the security group and I haven't changed anything since last night. Error: ssh: connect to host [ip address] port 22: Connection refused I had similar issue recently and i couldn't figure out why it was happening, so I had to create a new instance, set it up again, and connect and configure all EBS storages to the new one. Took

Python psycopg2 timeout

北慕城南 提交于 2019-12-03 05:43:07
I have a huge problem: There seems to be some hardware problems on the router of the server my python software runs on. The connection to the database only is successfull about every third time. So a psycopg2.connect() can take up to 5 minutes before I get an timeout exception. 2014-12-23 15:03:12,461 - ERROR - could not connect to server: Connection timed out Is the server running on host "172.20.19.1" and accepting That's the code I'm using. # Connection to the DB try: db = psycopg2.connect(host=dhost, database=ddatabase, user=duser, password=dpassword) cursor = db.cursor(cursor_factory

Android WiFi connection programmatically

对着背影说爱祢 提交于 2019-12-03 04:04:37
问题 Do you have any idea how to establish a wifi connection with sending password in my android application? 回答1: Pass the SSID and it's password to the following method. public void connectToAP(String ssid, String passkey) { Log.i(TAG, "* connectToAP"); WifiConfiguration wifiConfiguration = new WifiConfiguration(); String networkSSID = ssid; String networkPass = passkey; Log.d(TAG, "# password " + networkPass); for (ScanResult result : scanResultList) { if (result.SSID.equals(networkSSID)) {