From: Sim Zacks <sim@compulab.co.il>
To: PostgreSQL general <pgsql-general@postgresql.org>
Subject: Re: Using Postgresql as application server
Date: Thu, 18 Aug 2011 07:35:26 +0300
Message-ID: <4E4C968E.3060900@compulab.co.il> (raw)
In-Reply-To: <CAKt_ZftHwqGrYDhmMy3whik=5oqH7D5H1tQFGQrTJS98_7bMtA@mail.gmail.com>
References: <CAN2Y=uPjF14F5A9JXj02_vaPw4TMR0WGQid_w80xt4sC8o4qGg@mail.gmail.com>
<4E498536.9080109@darrenduncan.net>
<CAKt_Zft3XH_9bdcS-mZM6aSJ4824r7H3eFAx4CWwdoDwr=vb0A@mail.gmail.com>
<4E4B6571.6080207@compulab.co.il>
<CAKt_ZftHwqGrYDhmMy3whik=5oqH7D5H1tQFGQrTJS98_7bMtA@mail.gmail.com>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<style>body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body style="direction: ltr;"
bidimailui-detected-decoding-type="latin-charset" bgcolor="#ffffff"
text="#000000">
On 08/17/2011 06:13 PM, Chris Travers wrote:
<blockquote
cite="mid:CAKt_ZftHwqGrYDhmMy3whik=5oqH7D5H1tQFGQrTJS98_7bMtA@mail.gmail.com"
type="cite">
<pre wrap="">On Tue, Aug 16, 2011 at 11:53 PM, Sim Zacks <a class="moz-txt-link-rfc2396E" href="mailto:sim@compulab.co.il"><sim@compulab.co.il></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">We are doing this same sort of thing now. If the transaction goes through,
the email record gets written to a table. We have a cron job that calls a
database function that processes all emails that have not been processed
yet. If the transaction gets rolled back, the email record does not get
written to the table and the email does not get sent.
In your scenario, if you send the NOTIFY message and then you roll back the
transaction, the helper application will still send the email. IOW, doing
this outside of the database can more easily break your transactional
integrity.
</pre>
</blockquote>
<pre wrap="">Notify hits on commit, right?
Best Wishes,
Chris Travers
</pre>
</blockquote>
<p>My bad. I just tested this. Notify doesn't get send until after
commit.<br>
</p>
</body>
</html>
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: pgsql-admin@postgresql.org
Cc: sim@compulab.co.il, pgsql-general@postgresql.org
Subject: Re: Using Postgresql as application server
In-Reply-To: <4E4C968E.3060900@compulab.co.il>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox