agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Alexander Wöhrer <woehrer@par.univie.ac.at>
Cc: pljava-dev@pgfoundry.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: [Pljava-dev] stack depth limit exceeded - patch possible?
Date: Mon, 14 Apr 2008 11:23:46 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0804141112330.5378@leary.csoft.net> (raw)
In-Reply-To: <58782.88.116.137.78.1208177811.squirrel@www.par.univie.ac.at>
References: <48010499.30000@par.univie.ac.at>
	<Pine.BSO.4.64.0804131023000.9928@leary.csoft.net>
	<58782.88.116.137.78.1208177811.squirrel@www.par.univie.ac.at>



On Mon, 14 Apr 2008, Alexander Wöhrer wrote:

> am I understanding this correctly that pl/java sets it for the main Java
> thread, so other threads spawned by this main thread and using postgres
> SPI functionality will run into stack_depth_problems?

pljava sets the stack_base_ptr for each thread just before it calls into 
the backend using SPI and resets it when that thread finishes using SPI. 
Only one thread can access the backend at a time, so multi-threaded pljava 
code is safe and this mangling of the stack_base_ptr keeps the backend 
happy.

> Can you suggest another workaround?
>

Are you having any actual problems or is this all theoretical?  I don't 
believe you should be having any issues, but if you're having a real 
problem, please post a self-contained test case so we can look into it.

Kris Jurka


view thread (11+ messages)  latest in thread

Message-ID: <Pine.BSO.4.64.0804141112330.5378@leary.csoft.net>
Permalink:  ../Pine.BSO.4.64.0804141112330.5378@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.64.0804141112330.5378@leary.csoft.net

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
  Cc: books@ejurka.com, woehrer@par.univie.ac.at, pljava-dev@pgfoundry.org, pgsql-hackers@postgresql.org
  Subject: Re: [Pljava-dev] stack depth limit exceeded - patch possible?
  In-Reply-To: <Pine.BSO.4.64.0804141112330.5378@leary.csoft.net>

* 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