From fc81ed5fb1757e260eefb65ddee4591f26f2b42d Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Tue, 4 Dec 2012 21:54:28 +0000 Subject: [PATCH] FIX: Some jdbc drivers don't like absolute(0), even though this is allowed. As such, call beforeFirst() instead. Technically, these broken jdbc drivers should have the same kind of work-around. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1417210 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/org/ofbiz/entity/util/EntityListIterator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java b/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java index 405619afcc..6225150af8 100644 --- a/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java +++ b/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java @@ -211,7 +211,12 @@ public class EntityListIterator implements ListIterator { if (closed) throw new GenericResultSetClosedException("This EntityListIterator has been closed, this operation cannot be performed"); try { - return resultSet.absolute(rowNum); + if (rowNum == 0) { + resultSet.beforeFirst(); + return true; + } else { + return resultSet.absolute(rowNum); + } } catch (SQLException e) { if (!closed) { this.close();