PGCopyOutputStream Doesn't Hold Connection

Поиск
Список
Период
Сортировка
От Michael Daines
Тема PGCopyOutputStream Doesn't Hold Connection
Дата
Msg-id 461eb8dc-0a13-42c1-a84e-8a6545b0c58d@googlegroups.com
обсуждение исходный текст
Список pgsql-jdbc
Something that might be worth noting (in documentation?) is that the PGCopyOutputStream class doesn't hold a reference
toits Connection. 

We came across this because we were trying to keep our DB code separate from the logic, and we started getting errors
writingto the PGCopyOutputStream. We banged our heads against it for a while before realizing that the Connection was
gettinggarbage collected while we were still writing to it. 

Our solution was to extend PGCopyOutputStream and hold on to the Connection in that child class, also giving it
responsibilityfor closing it. 

I'm not sure I would call this a defect, but it is something I wanted to share with other people, since we couldn't
findanything in our searches on the problem while we were having it. 


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

Предыдущее
От: "David Johnston"
Дата:
Сообщение: Re: Parameters are not being setted in a copy statement
Следующее
От: Sérgio Saquetim
Дата:
Сообщение: Re: Severe performance degradation when using the 9.2-1000 JDBC 4 driver