Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: Re: Testing the functionality of sub classes Date: Sun, 20 Aug 2017 11:50:34 -0000 (UTC) Organization: A noiseless patient Spider Lines: 19 Message-ID: References: <87fucnh2wu.fsf@munus.decebal.nl> <87y3qffim5.fsf@munus.decebal.nl> <87pobrf855.fsf@munus.decebal.nl> Reply-To: avl@logic.at Injection-Date: Sun, 20 Aug 2017 11:50:34 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="cd31f327af7298cb41a335016b661fc8"; logging-data="10185"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Zg410GzpbCTgucjl+1KaC" User-Agent: slrn/1.0.2 (Linux) Cancel-Lock: sha1:2u2+GbM4iddj7aSEJ65s4OCF6Ck= Xref: csiph.com comp.lang.java.programmer:37312 Cecil Westerhof wrote: > For example: when creating a new ResultSet through a Statement the > previous generated should be closed. With the JDBC driver I use for > SQLite3 the old ResultSet is not closed, but becomes a copy from the > last generated. Are you sure about the "copy"? I'd rather expect(*) that the driver re-uses the particular ResultSet instance and returns the same ref again. (*: that is: based on your posted observations. Usually, instance re-use is frowned upon, like premature optimisation, but then again, DB driver vendors might have optimised it "well-maturely".) To verify (or disprove) it, you could run it in e.g. eclipse, and see if the same (or a new) "id" appears when you execute another query on the same Statement. Even without a debugger, you could print out the System.identityHashCode for the "two" returned ResultSet references.