Re: Remove usage of finalizers ?
От | Tom Dunstan |
---|---|
Тема | Re: Remove usage of finalizers ? |
Дата | |
Msg-id | CAPPfruy-NxMkfYARhEHkFY2NhFOVjKnZP2GQqVL6WXbf-h1ZYA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Remove usage of finalizers ? (Vitalii Tymchyshyn <vit@tym.im>) |
Список | pgsql-jdbc |
On 23 October 2013 12:29, Vitalii Tymchyshyn <vit@tym.im> wrote: > According to jdbc javadoc Statement.close simply releases resources without > waiting for them to be closed automatically. Interestingly, as recently as JDK 1.5 the javadoc for Statement said: > Note: A Statement object is automatically closed when it is garbage collected. ( http://docs.oracle.com/javase/1.5.0/docs/api/java/sql/Statement.html#close() ) That language seems to have been removed as of JDK 1.6, presumably because relying on finalizers for cleanup of any real resource hasn't been considered good practice since well before even then. And that was in 2006. I'm a little bit frightened now that there may be code out there relying on this behaviour, bad practice though it may be. Once again I'd like to know if this case makes any difference or not, given our other use of PhantomReferences etc. Tom
В списке pgsql-jdbc по дате отправления: