R: JDBC query creates a suspended Linux process

Поиск
Список
Период
Сортировка
От P.Rizzi Ag.Mobilità Ambiente
Тема R: JDBC query creates a suspended Linux process
Дата
Msg-id 1FED0E09CDDD1F4582BC454C4C879FAD72B61D@exchangesrv.agenzia.dom
обсуждение исходный текст
Список pgsql-general
I discovered myself what was causing this, but still I don't know
exactly why it was happening.
The table I was talking about has some 30.000 records, not that much,
but each insert triggers a pl/pgSQL function that does a few things
before actually inserting and it contains a few "raise info" statements
for debugging purposes.
Running the query from pgAdmin the output of those raise info are
displayed in the pgAdmin message window and the query runs smoothly.
Running the query from JDBC the output of those raise infos is not
displayed but is stored somewhere inside the JDBC driver.
Removing the raise info, the query runs smoothly even from JDBC!!!
Problem solved and a lesson learned...

Bye
Paolo Rizzi


> -----Messaggio originale-----
> Da: P.Rizzi Ag.Mobilità Ambiente [mailto:paolo.rizzi@ama-mi.it]
> Inviato: mercoledì 18 gennaio 2006 18.01
> A: PostgreSQL pgsql-general (E-mail)
> Oggetto: [GENERAL] JDBC query creates a suspended Linux process
>
>
> Hi everybody, this is my first post on this list.
> I searched the archives but couldn't find a solution for this.
>
> I have a PostgreSQL+PostGIS server installed on Linux with this
> configuration:
>    PostgreSQL 8.0.1 on i686-pc-linux-gnu, compiled by GCC gcc
> (GCC) 3.3.1
> (SuSE Linux)
> Linux is a SuSE 9.0 and the box is a two Xeon processor with
> 2GB RAM and two
> SATA HD
> configured in RAID 1 through an hardware adapter using ReiserFS.
>
> Now if I issue the query detailed below to this server using
> pgAdmin running
> on Windows, the query takes a reasonable time to complete (around 12
> seconds).
> If I issue the same query from a Java application using JDBC,
> the same query
> takes
> a very long time and this happens both if I ran the Java
> program from the
> same Windows
> machine or from the same Linux box where the PostgreSQL
> server is running.
> If I issue a ps command I can see that the Linux process
> running my query is
> suspended
> most of the time:
>     postgres 26992  1.9  0.9 36784 20040 ?       S    18:13   0:13
>                 postgres: postgres prova_sv3
> 192.1.1.36(1273) INSERT
>
> For example in this case I run the query more then 10 minutes
> ago, but it
> actually
> ran for only 13 seconds!!!
>
> The query is like this:
>
> begin;
> SELECT "sv_r".sv_ver_remarks('commit');
> INSERT INTO "sv_r"."Corsie"
>    SELECT
> "tipoCorsie_codice","posizione_codice","segm_progInizio","segm
> _progFine","se
> nso_elementoStradale_id","senso_sensoMarcia","ord","corsieDise
> gnate","numero
> Corsie","larghezzaMediaCorsie","geom","sv_ver"
>       FROM "sv_d"."Corsie";
> commit;
>
> SELECT "sv_r".sv_ver_remarks('commit'); invokes a simple
> pl/pgSQL function.
>
> INSERT INTO "sv_r"."Corsie" instead invokes a pl/pgSQL
> trigger function on
> each
> row that does a certain amount of work.
>
>    SELECT ...  FROM "sv_d"."Corsie"; reads from a complex view.
>
> So the query is complex, but why it takes 12 seconds from pgAdmin and
> forever from JDBC???
> I'm pretty sure to be correctly using a single transaction from JDBC.
> I'm not an expert with PostgreSQL nor I am a Linux guru so maybe is
> something really stupid...
> Thanks a lot in advance to anybody who'll help me!!!
>
> Bye
> Paolo Rizzi
>
>
>
>
> AVVERTENZE AI SENSI DEL D. LGS. 196/2003
> Le informazioni contenute in questo messaggio di posta
> elettronica e/o nel/i
> file/s allegato/i, sono da considerarsi strettamente
> riservate. Il loro
> utilizzo è consentito esclusivamente al destinatario del
> messaggio, per le
> finalità indicate nel messaggio stesso. Qualora riceveste
> questo messaggio
> senza esserne il destinatario, Vi preghiamo cortesemente di
> darcene notizia
> via e-mail e di procedere alla distruzione del messaggio stesso,
> cancellandolo dal Vostro sistema; costituisce comportamento
> contrario ai
> principi dettati dal D. Lgs. 196/2003 il trattenere il
> messaggio stesso,
> divulgarlo anche in parte, distribuirlo ad altri soggetti,
> copiarlo, od
> utilizzarlo per finalità diverse.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org
>




AVVERTENZE AI SENSI DEL D. LGS. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i
file/s allegato/i, sono da considerarsi strettamente riservate. Il loro
utilizzo è consentito esclusivamente al destinatario del messaggio, per le
finalità indicate nel messaggio stesso. Qualora riceveste questo messaggio
senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia
via e-mail e di procedere alla distruzione del messaggio stesso,
cancellandolo dal Vostro sistema; costituisce comportamento contrario ai
principi dettati dal D. Lgs. 196/2003 il trattenere il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse.

В списке pgsql-general по дате отправления:

Предыдущее
От: Steve Taylor
Дата:
Сообщение: Re: psql: FATAL: password authentication failed for user "xxxx"
Следующее
От: "surabhi.ahuja"
Дата:
Сообщение: logging connections