Friday, July 15, 2011

Force Iterator refresh with EJB Web Service DataControl

ADF Faces with EJB 3.0 Web services is among famous combination architects are committing to. It has its own winning and loosing grounds over ADFBc.
One of the issues that I found many developers struggle with is refresh of IteratorBinding, especially in scenario when repeated calls are made to same method binding. We found that sometimes, for reason yet to be discovered, iterator is not loaded with the fresh data.
One approach toward this issue is making use of Refresh Property which could be set to various values in drop down like always, default, ifNeeded, never etc. This is declarative approach and you should try it before attempting programmatically.
However if this doesn't works you can try invalidateCache() on the DCIteratorBinding. This too could be set declarative by setting cache result to false.. but some developers didn't had positive experience including me.