I see. It sounds a bit like a bug in the Derby driver. I don't see why TYPE_FORWARD_ONLY shouldn't be appropriate there. You should certainly be able to call hasNext() on such a ResultSet. It is in theory a valid optimization to tell the driver the ResultSet will only iterate forward.
On Thu, Oct 7, 2010 at 11:52 PM, Alec Feuerstein <[email protected]> wrote: > Well, I am running Derby on my local box. I have not tried this in > particular in our staging environment yet -- which is MySQL. I think > it is less a DB issue and more a JDBC thing. But, the Derby thing > does make me a bit uncertain. > > Basically, by setting ResultSet.TYPE_FORWARD_ONLY, isAfterLast is > throwing an error which is getting caught and then closing the > connection. To aggravate things hasNext -- where the call to > isAfterLast lives -- is called whenever you are trying to get any > data... > > Setting the result set as ResultSet.TYPE_SCROLL_INSENSITIVE clears > things up as it allows for scrolling. > > -Alec > > On Thu, Oct 7, 2010 at 2:13 PM, Sean Owen <[email protected]> wrote: >> Hmm, haven't heard of that. Can you provide more details, about the >> database and such? What you describe doesn't sound like correct >> behavior. Yes a patch would be great, in describing what the apparent >> issue is. >> >> On Thu, Oct 7, 2010 at 7:55 PM, Alec Feuerstein <[email protected]> wrote: >>> Hello, >>> >>> I don't suppose anybody has got getItemIDs or for that matter >>> getUserIDs working on a >>> org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel? >>> >>> For me, it is swallowing a NoSuchElementException due to a call to >>> isAfterLast and the ResultSet configuration. No ids are actually >>> returned. I am not totally sure that it is not my setup but I would >>> be surprised if it was... >>> >>> There is an easy fix I can submit as a patch if this really is a bug. >>> >>> -Alec >>> >> >
