Jdbc3PoolingDataSource default auto commit is false

Поиск
Список
Период
Сортировка
От Ryan Christianson
Тема Jdbc3PoolingDataSource default auto commit is false
Дата
Msg-id 3E8B2415.2080107@echospace.com
обсуждение исходный текст
Ответы Re: Jdbc3PoolingDataSource default auto commit is false  (Csaba Nagy <nagy@ecircle-ag.com>)
Список pgsql-jdbc
Hi.

I am useing Jdbc3PoolingDataSource to do database pooling. When I first
started using it some of my updates where not taking effect. So I
started enabled postgres logging and watched my queries, and I found out
why. The Jdbc3PoolingDataSource by default sets setDefaultAutoCommit to
false, and because of that, after every query it was calling "rollback".

To fix it, I extended Jdbc3PoolingDataSource, over-wrote the
createConnectionPool like so:
    protected ConnectionPool createConnectionPool() {
        ConnectionPool pool = super.createConnectionPool();
        pool.setDefaultAutoCommit(true);
        return pool;
    }

So my question is, how should I have worked with defaultAutoCommit set
to true? Would I need to wrap all of my queries in begin; and commit; ?

Thanks


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Barry Lind
Дата:
Сообщение: Re: Changing transaction isolation mid-transaction
Следующее
От: Ryan Wexler
Дата:
Сообщение: Re: prepared statements and sequences