Author: lektran
Date: Sun Aug 30 22:15:01 2009 New Revision: 809425 URL: http://svn.apache.org/viewvc?rev=809425&view=rev Log: Switched back to using scroll insensitive cursors, fixes problem reported by Jacques and Jacopo Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java?rev=809425&r1=809424&r2=809425&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/FindServices.java Sun Aug 30 22:15:01 2009 @@ -571,7 +571,7 @@ try { if (noConditionFind || (entityConditionList != null && entityConditionList.getConditionListSize() > 0)) { listIt = delegator.find(entityName, entityConditionList, null, fieldSet, orderByList, - new EntityFindOptions(true, EntityFindOptions.TYPE_FORWARD_ONLY, EntityFindOptions.CONCUR_READ_ONLY, -1, maxRows, distinct)); + new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, -1, maxRows, distinct)); } } catch (GenericEntityException e) { return ServiceUtil.returnError("Error running Find on the [" + entityName + "] entity: " + e.getMessage()); Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java?rev=809425&r1=809424&r2=809425&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityListIterator.java Sun Aug 30 22:15:01 2009 @@ -136,14 +136,6 @@ /** Sets the cursor position to first result; if result set is empty returns false */ public boolean first() throws GenericEntityException { try { - if (resultSet.getType() == ResultSet.TYPE_FORWARD_ONLY) { - if (resultSet.isFirst()) return true; - - if (resultSet.isBeforeFirst()) { - return resultSet.next(); - } - } - return resultSet.first(); } catch (SQLException e) { if (!closed) { @@ -219,23 +211,7 @@ if (closed) throw new GenericResultSetClosedException("This EntityListIterator has been closed, this operation cannot be performed"); try { - if (resultSet.getType() == ResultSet.TYPE_FORWARD_ONLY && Math.abs(rowNum) < this.getResultsSizeAfterPartialList()) { - int actualRowNum = rowNum; - if (actualRowNum < 0) { - actualRowNum = this.getResultsSizeAfterPartialList() + actualRowNum + 1; - } - while (actualRowNum != currentIndex()) { - if (actualRowNum > currentIndex()) { - this.next(); - } else { - // This will throw an exception but we would have to do that anyway - this.previous(); - } - } - return true; - } else { - return resultSet.absolute(rowNum); - } + return resultSet.absolute(rowNum); } catch (SQLException e) { if (!closed) { this.close(); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=809425&r1=809424&r2=809425&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Sun Aug 30 22:15:01 2009 @@ -1346,7 +1346,7 @@ if (iter instanceof EntityListIterator) { try { - ((EntityListIterator) iter).first(); + ((EntityListIterator) iter).beforeFirst(); } catch (GenericEntityException e) { Debug.logError(e, "Error rewinding list form render EntityListIterator: " + e.toString(), module); } |
Free forum by Nabble | Edit this page |