Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Application freezes after connection is dead

Application freezes after connection is dead

2006-07-20       - By Reinhard H?ttermann

 Back
--Alt-Boundary-5992 (See http://ary-5992.ora-code.com).289331546
Content-type: text/plain; charset=ISO-8859 (See http://ISO-8859.ora-code.com)-1
Content-transfer-encoding: Quoted-printable
Content-description: Mail message body

Hi,

Problem description:

I use unixODBC-2 (See http://DBC-2.ora-code.com).2.8-55 containing the driver manager MyODBC-unixODBC-3 (See http://DBC-3.ora-code.com).51=
.06-150
within a SuSE Linux 9.1 (i586) operating system.

I create handles to open a "permanent" connection to a MySQL database with=
SQLConnect
in an application (in this case a middleware). I send SQL-Statements via t=
his connection and
receives an answer for each of them. This all works fine.

Then I simulate a problem with the LINUX command:

iptables -A INPUT -p tcp  --destination-port mysql --source 10.128.64.56 -=
j REJECT

which interrupts the connection (I close the listening port of the databas=
e).

Trying the next SQL-Request with SQLExecDirect leads to a "frozen" applica=
tion, i.e. the
function SQLExecDirect never returns.

O.K., then I try to implement a workaround, i.e. I implement a timeout for=
the call of
SQLExecDirect to catch the frozen status of the function including a long =
jump to a function
to clean up the situation. It means I call SQLDisconnect(). But now this f=
unction never
returns, so the system is frozen again.

O.K. then I forget the clean up and try to establish a new connection with=
SQLConnect  and
new handles. But again: the function freezes.  

As a summary: After the connection is dead, every action on one of the obj=
ects (the
deallocation of the handles or a call of SQLDisconnect, SQLConnect, ...) r=
egarding the
connection leads to a non-responding application.

First question: Is there anybody who can tell me how to catch this situati=
on?

Second question: The usage of

sqlReturn =3D SQLGetEnvAttr(this->envHandle, SQL_ATTR_CONNECTION_DEAD,
                             &lConnectionStatus, sizeof(SQLINTEGER), NULL=
);

leads in any case to sqlReturn=3DSQL_ERROR

Why?

Thanks in advance for your help.
Reinhard H=FCttermann

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------=
-- ---- ---- ---- ---- ---- ---- ---- ---- -----
HaCon Ing.-Ges. mbH Hannover, Germany

--Alt-Boundary-5992 (See http://ary-5992.ora-code.com).289331546--