From: thomas at tada.se (Thomas Hallgren) Date: Sat, 25 Nov 2006 17:16:34 +0100 Subject: [Pljava-dev] java.sql.SQLException: SPI function SPI_prepare failed with error SPI_ERROR_UNCONNECTED In-Reply-To: References: Message-ID: <45686C62.6050806@tada.se> 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