I'm not sure, but using method Query.iterate() I think related ResultSet and Statement are
not closed if you don't traverse the Iterator till the end.
I would like to avoid problems in this type of scenario:
I have a CustomerPersistenceAdapter with a getWonderfulCustomers returning
and Iterator<Customer>.
Another developer needs only the first wonderful Customer and looking
at an already developed api he writes:
Code:
...
Iterator<Customer> it = persistenceAdapter.getWonderfulCustomers();
return (it.hasNext()) ? it.next() : null;
...
If the Iterator<Customer> returned by getWonderfulCustomers need to traverse
more than one Customer, are the ResultSet and Statement closed?
Can this create problems or there are other
subsystems to clean or notify this
situation?
Thanks in advance
Bye