Re: Closing Statements and ResultSets

Поиск
Список
Период
Сортировка
От Barry Lind
Тема Re: Closing Statements and ResultSets
Дата
Msg-id 3D7D0E69.7030104@xythos.com
обсуждение исходный текст
Ответ на Closing Statements and ResultSets  (Daniel Serodio <daniel@checkforte.com.br>)
Ответы Re: Closing Statements and ResultSets
Список pgsql-jdbc
Daniel,

If you are using virtually any connection pool closing the connection
alone will not be enough.  Because in a connection pool environment
closing a connection doesn't really close the connection, it just
returns it to the pool, thus any resources you haven't closed explicitly
will remain open and allocated.

--Barry

Daniel Serodio wrote:
>     Hi! I usually close just the Connection object, understanding that it's
> associated Statement's, PreparedStatement's and ResultSet's will be
> automatically closed.
>
>     I'm trying to setup Protomatter JDBC Connection Pool with PostgreSQL,
> and Protomatter's documentation state that "It's also important to make
> sure you close all Statement, PreparedStatement and ResultSet objects
> associated with a connection before you close the connection itself.".
>
>     I emailed Protomatter's author, and he said that "specifically Oracle
> is not good about doing that.  If you don't close the statements you'll
> eventually get an error like "can't open any more cursors" or something
> like that..."
>
>     My question is: do I need to close the Statements or is closing the
> Connection enough?
>


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

Предыдущее
От: snpe
Дата:
Сообщение: Re: [HACKERS] problem with new autocommit config parameter and jdbc
Следующее
От: Vernon Wu
Дата:
Сообщение: Chinese in pgsql + jdbc