connection

What is the `connection` parameter of MapperExtension in sqlalchemy?

The class MapperExtension has some methods, and before_insert, before_update, ... all have a parameter connection. def before_insert(self, mapper, connection, instance): I've read the documents of MapperExtension, but found nothing about this connection. What is it? And how to use it? ...

Java 1.4.2 - Single http proxy connection

I need to create a single http proxy connection and i don't want to use java common environment variables such as http.proxyHost and http.proxyPort (should i care about modifying them?). There is an ibm jre, so i can't use sun.net.www.protocol.http.HttpURLConnection out of the box. Is it a normal practice to store http.proxy* variables...

Junit test case: Connection refused case

Hi all, I am writing a Junit(4.x) test to test what happens when the web application is down. When I hit the url in the browser, I get a message saying "Connection refused". I am unsure about what to check for in the assert statements. Do I check the header for this message? -- urlConnection.getResponseMessage() or just say (exp...

Basic Ruby SQL Problem Error undefined method `[]'

I think I'm being stupid. rc = Mysql.new('CENSORED_HOST','username','password','db') release = rc.query('select * from wp_ribcage_releases where release_id = 1 limit 1') puts release["release_title"] rc.close And I am getting the following error: ribcage-connect.rb:17: undefined method `[]' for #<Mysql::Result:0x1011ee900> (NoMetho...

query results can't be enumerated more than once - problem with retrieving data from database

Hi I have a strange problem with retrieving data from database. In my form I have a combobox. The combobox contains couple of items - department's name. Everytime I choose an item from combobox I connect to database and fire this public List<User> SelectAllSecurityUsersByDepartment(string departmentId) { var result = DBConne...

Python decorator to refresh cursor instance

Hello, I have a method to save data in DB, and a decorator to manage the connection, but I can't figure out how to make it work. method to save: class DA_Row(DABase): @DABase.connectAndDisconnect def save(self): """ Guarda el spin en la base de datos """ self.__cursor.callproc('sp_insert_row', (...

memory leak on shared delegate

Hi friends, I am using shared delegate for getting data on url connection. I getting a memory leak on my code. Can anybody please tell me what i have done wrong. Thanks in advance. Analyser Warning: /Users/sathish/Documents/XXX 20100908 ManageMem/Classes/Data Download/XXX DataConnect.m:68:22: warning: Potential leak of an object alloc...

android Service needs to handle connection failure - how?

I've got an app that retrieves data on a regular basis from the internet (3 times a week). The data on the server is available via an XML api (which I built) and which works without any problem. However, some of the users handsets are not on/connected when the call is made. What is the best way to handle this lack of net connection fa...

Library? C or Python - Socks5 proxy a non-socks aware application.

I need to write an application that will use an open socks5 proxy and tunnel data through it; eg. Photoshop does not support connections via a proxy, I want to create an app that will take all connections from photoshop and run them through the socks5 proxy. Any help would be great, thanks :) ...

iPhone: Catching a Connection Error With NSStream

I have written a program that connects to a server on a given IP using the NSStream protocol outlined in Apple's stream programming guide. The connection and transfer of data works flawlessly, however if the user specifies the wrong IP and the program attempts to open the streams it results in the program becoming unresponsive. From wha...

Zend Framework slow connect to Mysql

Using Zend_Db_Profiler_Firebug and FirePHP to profile our code, all other queries after the connect is fast, but it seems to take forever for Zend Framework to establish a connection to mysql, I've googled the problem and others suggest using table metadata cache which I did, but the problem still persists. ZendDbTableAbstract::setDefau...

Detect if the computer is using a mobile connection (3G/EDGE/GPRS) on Windows

I need to determine if the computer is connected to the Internet using a mobile connection (e.g. 3G, EDGE, GPRS). I found this identical question, but the accepted answer isn't very helpful to me... The System.Net.NetworkInformation.NetworkInterface class exposes a few properties, but nothing that can help me determine if it is a mobile ...

MySqlConnection.Open() waits indefinitely

I am using MySqlConnector/Net 5.2.7 in one of my applications written in C# for .NET 2.0. This application is deployed across different sites in the corporate network. This week, this application refused to connect to the database from a remote site suddenly. Actually, the MySqlConnection.Open() method does not return and waits indefini...

doctrine2 can't connect to db?

I've been happily integrating Zend Framework and Doctrine for the past week or two. I've just rebuilt the db after updating my docblock annotations and now i get this mysterious error: Maximum execution time of 30 seconds exceeded in /Doctrine/DBAL/Connection.php on line 567 ?!? Any clues? ...

Connecting Thunderbird to Exchange via DavMail

Sending of password did not succeed. Mail server localhost responded: Unable to get mail folder at /exchange/[email protected]/, Webdav not available on Exchange server This is the message the Thunderbird (and DavMail) show to me when i try to connect. I've set thunderbird as the DavMail guide suggest. Setting in Da...

ITransformableFilterValues interface with two or more parameters [SharePoint WebParts]

I working with Sharepoint, and I try to connect web-parts with multiple parameters. My question is how do I pass more than one parameter from a custome web part to another. I am able to pass one parameter by implementing the ITransformableFilterValues interface in the custom webpart , what I want to do is pass more than one parameter (...

Stomp Connection Bleeding

I am connecting to Active via PHP Stomp client as publisher. So the arch. is - HTTP Request to PHP - Connect to ActiveMQ - Publishe message to a topic - Disconnect However, after sometime the I can see bunch of active connection under Stomp Connector under Admin section http://:8161/admin/connections.jsp Few entries are as foll...

Keep TCP connection persistent even after sub-routine calling connect() is end. How?

I have an application that calls connect() in a subroutine A. This sub-routine A is called when a button A is pressed. After connection has established, user can choose to click button B. This button B has to be programmed as a separate sub-routine. However, I need TCP connection to run sub-routine B. After connect() is called in s...

Why would I get "error: 26 - Error Locating Server/Instance Specified" on 1 server, not another, and only for some database calls?

When running a .NET 3.5 web app (C# code behind) on my local machine, I encounter error 26 "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connect...

Connecting to mysql in ruby produces wrong number of arguments error (4 of 0) - how to debug?

I'm trying to connect to a hosted MySQL database from my Ruby script. require "rubygems" require "mysql" con = Mysql::new('host', 'user', 'pass', 'database') Running this results in: ArgumentError: wrong number of arguments (4 for 0) method initialize in untitled at line 4 method new in untitled at line 4 at top level ...