agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] stack depth limit exceeded (NOT from infinite	recursion)
Date: Fri, 23 Sep 2005 11:42:13 +0200
Message-ID: <thhal-0eGYPBK1j8bQ1Po6k0VxX2qdvj4MpCS@mailblocks.com> (raw)
In-Reply-To: <4333C332.3060302@tokuii.com>
References: <4333C332.3060302@tokuii.com>
	<4333CDF5.9040207@mailblocks.com>
	<thhal-0eGYPBKtj8bQVL/zrUF/3KkUJjDRvrG@mailblocks.com>

kstian wrote:

> Hi,
>
> I created the following Trigger and Function:
>
> ======================================
>        CREATE FUNCTION afterUpdateTsr()
>            RETURNS trigger
>            AS 'pljava.Triggers.afterUpdateTservicerequest'
>            LANGUAGE java;
>
>        CREATE TRIGGER tsr_afterUpdate
>            AFTER UPDATE ON tsr
>            FOR EACH ROW
>            EXECUTE PROCEDURE afterUpdateTsr(name);   
> ==========================================
>
> Then in the afterUpdateTsr() java function, I was writing codes to 
> connect to servicemix (a JBI container).
>
> In order to do that, I had to install 11 jar files in my postgresql 
> table using sqlj.install_jar function.
>
> When the aferUpdateTsr() got triggered, it was throwing "stack depth 
> limit exceeded" exception from native C. (I believed it's from 
> ExecutionPlan.c).  I also printed out the loaded classes from 
> sqlj/Loader.java (findClass function) and found that pljava was 
> loading a lot of classes.
> Was it the main reason causing this exception?  How do I resolve this 
> problem?
>
Normally, a "stack depth limit exceeded" exception is caused by a 
function that calls SQL, that in turn calls a function that calls SQL, 
etc. until you recurse so deep that the PostgreSQL callstack is 
exhausted. If it's a controlled and expected recursion you can try to 
increase the max_stack_depth variable in your postgresql.conf

If you this doesn't help, then I'll have to know a bit more about what 
your triggers are doing in order to assist you.

Kind regards,
Thomas Hallgren








view thread (7+ messages)  latest in thread

Message-ID: <thhal-0eGYPBK1j8bQ1Po6k0VxX2qdvj4MpCS@mailblocks.com>
Permalink:  ../thhal-0eGYPBK1j8bQ1Po6k0VxX2qdvj4MpCS@mailblocks.com/
Also on:    postgresql.org/message-id/thhal-0eGYPBK1j8bQ1Po6k0VxX2qdvj4MpCS@mailblocks.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] stack depth limit exceeded (NOT from infinite	recursion)
  In-Reply-To: <thhal-0eGYPBK1j8bQ1Po6k0VxX2qdvj4MpCS@mailblocks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox