[Pljava-dev] java.sql.SQLException: SPI function SPI_prepare failed with error SPI_ERROR_UNCONNECTED

Lists: pljava-dev
From: claudioaferraz at gmail(dot)com (claudio ferraz)
To:
Subject: [Pljava-dev] java.sql.SQLException: SPI function SPI_prepare failed with error SPI_ERROR_UNCONNECTED
Date: 2006-11-25 01:05:39
Message-ID: d522589d0611241705h3fd69568qf4883031587845f8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

Hello everybody !!!

My name is Cl?udio Ferraz, i m from Brazil.
I am receiving the following error when execute my java procedure

INFO: 24 Nov 06 22:43:38 java.sql.SQLException: SPI function SPI_prepare
failed with error SPI_ERROR_UNCONNECTED

My procedure is a schedule that execute a taks every X seconds.
The schedule works, but every X secunds i receive the error message, and
my task breaks.

INFO: 24 Nov 06 22:43:38 axml.AgenteVerificador Agente still running...
INFO: 24 Nov 06 22:43:38 axml.AgenteVerificador Erro ao pegar
servi?os...java.sql.SQLException: SPI function SPI_prepare failed with error
SPI_ERROR_UNCONNECTED
INFO: 24 Nov 06 22:43:43 axml.AgenteVerificador Agente still running...
INFO: 24 Nov 06 22:43:43 axml.AgenteVerificador Erro ao pegar
servi?os...java.sql.SQLException: SPI function SPI_prepare failed with error
SPI_ERROR_UNCONNECTED

Sorry my poor english, thanks everybody !

--
Cl?udio A. Ferraz - Analista de Sistemas
Mestrando em Banco de Dados COPPE/UFRJ
"Se n?o puder fazer tudo, fa?a tudo o que puder."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20061124/761552e4/attachment.html>


From: thomas at tada(dot)se (Thomas Hallgren)
To:
Subject: [Pljava-dev] java.sql.SQLException: SPI function SPI_prepare failed with error SPI_ERROR_UNCONNECTED
Date: 2006-11-25 16:16:34
Message-ID: 45686C62.6050806@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pljava-dev

Hi Claudio,
Have you thought about the transaction semantics of this procedure? A transaction will
always be active when you call the procedure. It will remain active during the call. When
the call returns, the transaction will (perhaps) end.

So, if you for instance have a call that never returns (it iterates forever and does
something each second instead), that means your transaction will never commit. If you
instead spawn a new thread and then return and that thread sits in the background and
attempts to access the database once every second, then it's very likely that you get the
errors that you now see. The transaction is no longer active. It ended when the main thread
did returned from the initial call.

Kind Regards,
Thomas Hallgren

claudio ferraz wrote:
> Hello everybody !!!
>
> My name is Cl?udio Ferraz, i m from Brazil.
> I am receiving the following error when execute my java procedure
>
> INFO: 24 Nov 06 22:43:38 java.sql.SQLException: SPI function
> SPI_prepare failed with error SPI_ERROR_UNCONNECTED
>
> My procedure is a schedule that execute a taks every X seconds.
> The schedule works, but every X secunds i receive the error message,
> and my task breaks.
>
>
> INFO: 24 Nov 06 22:43:38 axml.AgenteVerificador Agente still running...
> INFO: 24 Nov 06 22:43:38 axml.AgenteVerificador Erro ao pegar
> servi?os...java.sql.SQLException: SPI function SPI_prepare failed with
> error SPI_ERROR_UNCONNECTED
> INFO: 24 Nov 06 22:43:43 axml.AgenteVerificador Agente still running...
> INFO: 24 Nov 06 22:43:43 axml.AgenteVerificador Erro ao pegar
> servi?os...java.sql.SQLException: SPI function SPI_prepare failed with
> error SPI_ERROR_UNCONNECTED
>
> Sorry my poor english, thanks everybody !
>
> --
> Cl?udio A. Ferraz - Analista de Sistemas
> Mestrando em Banco de Dados COPPE/UFRJ
> "Se n?o puder fazer tudo, fa?a tudo o que puder."
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/pljava-dev