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

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
Thread:
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

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Gabriel Velo 2006-11-25 16:18:08 [Pljava-dev] Starting PostgreSQL 8.1 database server: mainError: Invalid line 435 in /etc/postgresql/8.1/main/postgresql.conf
Previous Message claudio ferraz 2006-11-25 01:05:39 [Pljava-dev] java.sql.SQLException: SPI function SPI_prepare failed with error SPI_ERROR_UNCONNECTED