Re: Child program using parent program's transaction?

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Child program using parent program's transaction?
Date: 2006-09-12 15:36:17
Message-ID: 20060912153617.GB14580@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Sep 06, 2006 at 03:21:04PM -0700, Wayne Conrad wrote:
> Today, it would once again be convenient to have an exec'd program do
> its work in the context of its parent program's transaction. So,
> before I once again decide that I don't actually want to do that, can
> you tell me... is it possible? And, would any sane person do it?

This isn't exactly the same thing, but I've seen something similar
done with threads. What I have to say about it is that it appears to
be easy to do when you decide to do it, but it turns out to be hard
to do well in practice. I cannot count the number of bugs I've come
across because of poor handling of this sort of situation. In
particular, in my experience, what you start to realise is that the
handoff period is super ultra critical, and subject to all sorts of
nasty race conditions; so you start locking things up in an effort to
avoid the race. In no time at all, the whole application has ground
to a halt while everything goes through this serialised global
choke-point. It is at this point that you decide there's a reason
the system doesn't do this sort of thing out of the box ;-)

A

--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
Everything that happens in the world happens at some place.
--Jane Jacobs

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John McCawley 2006-09-12 15:56:09 Bytea to Text problems
Previous Message Martijn van Oosterhout 2006-09-12 15:15:55 Re: initdb: invalid locale name "sv_SE.ISO-8859-1"