Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 99887 invoked from network); 2 Apr 2009 22:28:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Apr 2009 22:28:56 -0000 Received: (qmail 48732 invoked by uid 500); 2 Apr 2009 22:28:55 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 48678 invoked by uid 500); 2 Apr 2009 22:28:55 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 48668 invoked by uid 99); 2 Apr 2009 22:28:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 22:28:55 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [213.36.240.240] (HELO mail.te-mailbox.com) (213.36.240.240) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 22:28:47 +0000 Received: from [192.168.1.101] (82.228.128.187) by mail.te-mailbox.com (7.3.117.3) (authenticated as tlaurier@visp.tiscali.fr) id 4974BB6F003AFCAC for modules-dev@httpd.apache.org; Fri, 3 Apr 2009 00:28:25 +0200 Message-ID: <49D53C01.5080508@cynetek.com> Date: Fri, 03 Apr 2009 00:28:17 +0200 From: MySoLo User-Agent: Thunderbird 2.0.0.19 (X11/20090126) MIME-Version: 1.0 To: modules-dev@httpd.apache.org Subject: Failure request with apr dbd and postgresql X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I'm writing a module with apr dbd ( and mod_dbd for initialize dbd ). post_read hook is used for dbd_acquire_fn , get statement, pvselect, etc.... When use dbd with DBDriver pgsql , request fail after 5, 6 wget test, after two with firefox refresh. No problem with driver sqlite3 or mysql. oracle, freetds or other are not tested. Simple config for mod_dbd is: DBDriver pgsql DBDParams "dbname=vhost user=vhost password=vhost" With postgresql 7.4 if use DBDPersist off but if not use or force on i'm error (idem with postgresql 8.3): ex test: portoo ~ # wget -O index.html "http://vhost0.com" vhost0.com is local :) [Thu Apr 02 23:40:10 2009] [debug] mod_vhost_dbd.c(357): [client 192.168.100.1] vhost_dbd_post_read: path=/home/mysolo/test/vhost0 <----------- it's ok ....... [Thu Apr 02 23:40:13 2009] [error] [client 192.168.100.1] Query execution error looking up 'vhost0.com' in database [Thu Apr 02 23:40:13 2009] [error] [client 192.168.100.1] another command is already in progress\n and if use DBDPersit off with postgresql 8.3 , it's error [Fri Apr 03 00:16:16 2009] [error] (20014)Internal error: DBD: Can't connect to pgsql [Fri Apr 03 00:16:16 2009] [error] [client 192.168.100.1] Failed to acquire database connection to look up host 'vhost0.com' apr-util bug or bug in pqlib of postgresql. I'm searching bug list of apr/apache or postgresql , or google and don't found response. Helping for found problem with postgresql. complete code is on https://svn.cynetek.com/pub/mod_vhost_dbd/trunk/ Excuse me for my english. I speak french only :) I'm use standard code for acquire, get statement and pvselect. .... dbd = vhost_dbd_acquire_fn(r); if (dbd == NULL) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Failed to acquire database connection to look up host '%s'", host); return DECLINED; } statement = apr_hash_get(dbd->prepared, conf->label, APR_HASH_KEY_STRING); if (statement == NULL) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "A prepared statement could not be found for " "VhostDBDQuery with the key '%s'", conf->label); return DECLINED; } /* execute the query of a statement and parameter host */ if (rv = apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle, &res, statement, 0, host, NULL) != 0) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Query execution error looking up '%s' in database", host); ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, apr_dbd_error(dbd->driver, dbd->handle, rv)); return DECLINED; } // ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "vhost_dbd_post_read: apr_dbd_get_row return : %d", rv); if (rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1)) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "No found results for host '%s' in database", host); ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "vhost_dbd_post_read: result of apr_dbd_get_row=%d", rv); return DECLINED; }