Skip to main content

Posts

Showing posts from September, 2011

ADF : On the hunt for connection leaks

We changed our connection pool to only use connection pools in weblogic and also to swap connection pool depending on a login selection ( http://dailydevfixes.blogspot.com/2011/09/using-environment-info-provider-to.html ). We are now running out of connections at a rapid rate - each task flow seems to create 2 new connections so off to weblogic console I go. (Enviroment\Servers\[YourServer]\Monitioring\JDBC). To monitor the info I used the dashboard (dont forget to push the play button): http://[your server]:7101/console/dashboard Will update this thread as the hunting progresses. Ok so my hunting ended in disappointment today - there where no connection leaks here is my scenario: We had multiple AM's working off the same Data source. Each Application module had the value of Referenced Pool Size set to ten. Each request to a taskflow created a new application module and thus a new connection only once the Referenced Pool Size value of connections where reached did it ...
When mapping a checkbox (Database value 'Y' or 'N') to a lov first map the UI hint Control Type to Checkbox. This is due to the fact ADF disables this field and set it to Choice List automatically when a lov is mapped.

ADF: Rollback findings - generic rollback ordering of iterators

Ok so a couple of our screens where not working with the generic rollback I wrote. I was getting a key not found exception. Through a bit of debugging i found the problem, I was using getDCBindingContainer().getAllIterBindingList() to get a list of iterators use in the page I was on - the problem with this is if the bindings on your page are not in order you could end up refreshing the child iterator before refreshing the parent and thus your keys will not be correct. I swapped the order of my iterators in the page binding and it all worked. I now need to write some code to refresh the parents first then the children. Here we go   ArrayList list = ADFUtils.getDCBindingContainer().getAllIterBindingList(); for(Object listItem : list) { if(bondage.getViewObject() instanceof ViewObjectImpl) { ViewObjectImpl vo = (ViewObjectImpl) bondage.getViewObject();      if(vo.isPagePositionSet()) {        RowSetIterator[] mrsi...

ADF A refreshing graph with a af:poll

I wanted to have my adf graph component refresh every 10 seconds or so to reflect the latest info. I wasn't really interested in Active data to push the info to me when it changed as it changed too often. So this is super simple and involved the following steps: 1) Drag on a poll component (Component pallet --> operations --> poll) 2) Add a partial trigger to your graph. ( partialTriggers="::poll1") where poll1 is the id of the poll component. 3) viola it just works. Poll Properties interval - How long in miliseconds between polls timeout - Amount of time before the poll stops due to inactivity this will make sure a users session can timeout on this page due to inactivity as a poll is seen as activity (-1 infinite). pollListener - Add some custom code to each poll event.   public void yourPoll(PollEvent pollEvent) {

DVT stuff

I am currently playing around with some of the gauge, graph and data visualization components in ADF. At the moment it is all going well provided I drag the ADF BC components on the screen, the custom stuff takes a bit of work. Here is a silly example to show the number of days until password expiry in a gauge: JSF COMPONENT <dvt:gauge id="gauge1" gaugeType="DIAL" value="#{viewScope.dashboardBean.gaugeValue}">   <dvt:gaugeBackground>     <dvt:specialEffects/>   </dvt:gaugeBackground>   <dvt:thresholdSet> <dvt:threshold thresholdMaxValue="5" fillColor="#ff0000"/> <dvt:threshold thresholdMaxValue="15" fillColor="#FF7F27"/> <dvt:threshold fillColor="#00ff00"/>   </dvt:thresholdSet>   <dvt:gaugeFrame/>   <dvt:indicator/>   <dvt:indicatorBase/>   <dvt:gaugePlotArea/>   <dvt:tickLabel/>   <dvt:tickMark/...

JDeveloper autocommit off on SQL worksheet

Goto tools / Prefrences in the top menu in Jdeveloper Select Database/ Worksheets Check AutoCommit in SQL Worksheet off / on as you wish

ADF to service enabled bindings : findings

Service enablement It is very easy to expose your adf code in any application module as services with just a couple of clicks. (Although this may not be the best thing to do without thought) This could allow you to leverage your existing investment in ADF and publish the existing code as needed to your SOA enviroment. EO bindings You can base Entity Objects on services and have all the same rich functionaltiy adf provides yet using a service backed entity. Webservice data control This control allows you to incorporate web services in any ADF page simply and quickly Pojo custom control This allows you the most flexibility you can create a custom data control off a pojo and use this to call you web services. With these tools you can integrate any third party or internal services into your adf application quickly and easily. All in all I was pleasantly surprised with the service integration in ADF. Although there are a couple of things that where tricky (custom LOV's ...

ADF Calling a Find on your service based AM

So I struggled a bit to do this code because I was unfamiliar with eclipselink SDO stuff so hope this saves you some time. I just wanted to call the AM service find from my backing bean. The first parameter of the defineSchema method is the fully qualified path to your Application Module xsd. The second parameter is your xsd name. import oracle.jbo.common.sdo.SDOHelper; import oracle.jbo.common.service.types.FindControl; import oracle.jbo.common.service.types.FindCriteria; ...   SDOHelper.INSTANCE.defineSchema(     "za/co/transcode/adf/mdm/model/common/serviceinterface/",      "MDMAppModuleService.xsd");   FindControl fci =     (FindControl)DataFactory.INSTANCE.create(FindControl.class);   fci.setRetrieveAllTranslations(false);   FindCriteria fcrit =     (FindCriteria)DataFactory.INSTANCE.create(FindCriteria.class);     Map paramMap = new HashMap ();   fcrit.setFet...

ADF 11.1.2 rollback again

I have an editable list with a child editable list and wanted all my list to retain there position on rollback so I wrote some code. Had to be slightly tweaked from what I user to have. The first method saves all current iterator binding positions to a IteratorPosition class (just a pojo with range start etc getters and setters - nothing fancy) The second method restores those positions to the iterator bindings and all is now working as I want. Also remember this button is a toolbarbutton with the following: partialSubmit="false" immediate="true" and a resetactionlistener - without these things it may not work correctly. public static Map saveBindings() {   Map returnValues = new HashMap ();   ArrayList list = ADFUtils.getDCBindingContainer().getAllIterBindingList();   for(Object listItem : list) {     if(listItem instanceof JUIteratorBinding &&       !"listIter".equalsIgnoreCase(((JUIteratorBinding) listItem...