[pgpool-general: 4180] Re: documentation bug?

Yugo Nagata nagata at sraoss.co.jp
Tue Nov 10 14:14:56 JST 2015


Hi Pablo,

On Mon, 9 Nov 2015 15:35:33 -0500
Pablo Sanchez <pablo at blueoakdb.com> wrote:

> Hi everyone,
> 
> I think we might have a documentation bug.
> 
> As I understand the 'flow chart'[1], the following SELECT will not be
> Load Balanced:
> 
>      START TRANSACTION
>         SELECT * FROM my_table ...
>      COMMIT;
> 
> The documentation states[2] when the JDBC driver's 'autocommit' option is
> set to FALSE, it wraps all queries around a 'BEGIN' and 'COMMIT' and
> thus they will not be Load Balanced.

Yes, though there're exception for some conditons as described in doc.

> 
> I believe the documentation should read TRUE, not FALSE.

Do you mean the correct statement is:

"when the JDBC driver's 'autocommit' option is set to **TRUE**, 
it wraps all queries around a 'BEGIN' and 'COMMIT"?

This is wrong. When autocommit is true, the query is sent without BEGIN
and committed  implicitly if this isn't in a transaction block.[1][2]


[1] http://www.postgresql.org/docs/9.4/static/sql-begin.html

[2] https://docs.oracle.com/javase/tutorial/jdbc/basics/transactions.html#disable_auto_commit

> 
> In Googling around[3], it seems when the JDBC driver's 'autocommit'
> option is set to TRUE (not FALSE) is when each SQL is an implicit
> transaction.
> 
> ::: References :::
> 
> [1] - http://www.pgpool.net/docs/latest/where_to_send_queries.pdf
> 
> [2] - 
> http://www.pgpool.net/docs/latest/pgpool-en.html#condition_for_load_balance
> 
>     Note: the JDBC driver has an autocommit option. If the autocommit is
>     false, the JDBC driver sends "BEGIN" and "COMMIT" by itself. In this
>     case the same restriction above regarding load balancing will be
>     applied
> 
> [3]
> 
> o 
> http://stackoverflow.com/questions/24683391/why-autocommit-is-by-default-false-in-hibernate-when-we-have-the-transaction-man
> 
>    - see the response (2)
> 
> o 
> http://www.coderanch.com/t/463713/ORM/databases/disabling-autoCommit-hibernate
> -- 
> Pablo Sanchez - Blueoak Database Engineering, Inc
> Ph:    819.459.1926         Blog:  http://pablo-blog.blueoakdb.com
> iNum:  883.5100.0990.1054
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general


-- 
Yugo Nagata <nagata at sraoss.co.jp>


More information about the pgpool-general mailing list