Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Detecting 'socket errors' - closing the Connection object: msg#00368

db.postgresql.jdbc

Subject: Re: Detecting 'socket errors' - closing the Connection object

David Wall wrote:
When we get the SQLSTATE patch in you'll be able to do:

if ((e.getSQLState() != null) && (e.getSQLState().equals("08S01")))
throw new ExplainException("Communication link error: " + e.getMessage());


Thanks, Fernando. Unfortunately, this will be a postgresql-ism, not a JDBC
library-ism, and it will likely require that the user be on a particular
version of the database, too (or is this bit going to work even on 7.3 and
pre 7.3 versions too?). I'm looking for something that doesn't require a
special patch for each of the myriad databases our customers use (MSFT SQL
Server, Oracle, PostgreSQL MySQL and DB2/UDB to name the current list).


First of all, this is plain SQL + JDBC specs.

The code falls into the "implementation defined" range, but ODBC, DB2 and Oracle use the same and my patch followed that convention (a sort of de facto standard for some of these values not pre-defined in the SQL standard itself). I don't know if all vendors did the same though -- I just checked these three. It is a limitation of the standards that they did not come out with a more compreheensive set of pre-defined numbers. I guess they do spect the applications to cope with the error code differences somehow.

My patch was originally against 7.3, but it only includes the conditions detected by the driver. The backend will only spit SQLSTATEs from 7.4 on (i.e., V# protocol).






--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@xxxxxxxxxx
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe