Friday, August 14, 2009

Range Paging in Master Detail bug. (Fixed in 11.1.1.3)

When i thried to set Range Paging in some view objects in our application i had the following exception:


oracle.jbo.InvalidOperException: JBO-25011: Rowset Employees_Departments1_EmpDeptFkLink_DepartmentsView_0 is forward only. at oracle.jbo.server.ViewObjectImpl.validateRangeSizeForRangePaging(ViewObjectImpl.java:13522) at oracle.jbo.server.ViewRowSetIteratorImpl.setRangeSize(ViewRowSetIteratorImpl.java:529) at oracle.jbo.server.ViewRowSetImpl.setRangeSize(ViewRowSetImpl.java:2633) at oracle.jbo.server.ViewObjectImpl.doCreateViewLinkAccessorRS(ViewObjectImpl.java:13534) at oracle.jbo.server.ViewObjectImpl.createViewLinkAccessorRS(ViewObjectImpl.java:13624) at oracle.jbo.server.AssociationDefImpl.get(AssociationDefImpl.java:405) at oracle.jbo.server.ViewAttributeDefImpl.get(ViewAttributeDefImpl.java:773) at oracle.jbo.server.ViewRowStorage.getViewLinkAccessorResult(ViewRowStorage.java:1365) at oracle.jbo.server.ViewRowStorage.getAttributeInternal(ViewRowStorage.java:1579) at oracle.jbo.server.ViewRowImpl.getAttributeValue(ViewRowImpl.java:1795) at oracle.jbo.server.ViewRowImpl.getAttributeInternal(ViewRowImpl.java:783) at model.EmployeesViewRowImpl.getMasterDepartment(EmployeesViewRowImpl.java:522)

This happens if you use a master Accessor in a detail view object.
So i reproduced in a simple test case:


I have a simple Departments Employees master detail relation.

In Employees view object i create a transient Attribute IsDepartmentManager that i want to check if the employee is the manager of the department.

To do that i need the department assecor in Employees. so i do that from the View link.


In the getter of transient attribute i get the attribute of master :
public Boolean getisDepartmentManager() {
Object depManager = this.getMasterDepartment().getAttribute("ManagerId");
return depManager != null && depManager.equals(this.getEmployeeId());
}

When i Run application, everything is working fine:


But if i set Range Paging on tuning of Departments View and run again :


Is this a bug?

Am i missing something?

Test case:
http://adfbugs.googlecode.com/files/TestRPMasterDetail.zip

2 comments:

  1. Filed bug# 8807859 for tracking with your testcase, thanks. The workaround is to (a) set access mode to "Scrollable" on the DepartmentsView VO definition, and then to (b) edit the VO instance in the data model by selecting it in the "Data Model" panel and clicking (Edit) to set the access mode to "Range Paging" just on that particular VO instance used in the user interface.

    ReplyDelete
  2. Nice post Mike! Once more you proved to be a Time Savior!

    ReplyDelete