Re: Set readonly transaction per transaction

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Dave Cramer <pg(at)fastcrypt(dot)com>, Alexandor84 <oleksandr(dot)sukhotskyi(at)gmail(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Set readonly transaction per transaction
Date: 2014-12-09 19:40:09
Message-ID: 2006725267.4564708.1418154009521.JavaMail.yahoo@jws10084.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Dave Cramer <pg(at)fastcrypt(dot)com> wrote:
> On 8 December 2014 at 03:17, Alexandor84 <oleksandr(dot)sukhotskyi(at)gmail(dot)com> wrote:

>> No one faced with such problem?

> Apparently not. I doubt many people use pgbouncer in transaction
> mode.
>
> Can you explain why you are using transaction mode ?

Hey, now! I often recommend transaction mode, because I have seen
applications scale to a much higher concurrency that way. See:

https://wiki.postgresql.org/wiki/Number_Of_Database_Connections

and:

http://stackoverflow.com/questions/10419665/how-does-pgbouncer-help-to-speed-up-django/10420469#10420469

As a suggestion to the original poster, how about executing:

SET read_only = on;

... as the first statement of a new transaction?

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ondrej Chaloupka 2014-12-10 08:08:41 Incorrect return code for error on call of commit during 2PC
Previous Message Dave Cramer 2014-12-08 10:51:36 Re: Set readonly transaction per transaction