Tuesday, October 27, 2009

ADF: Export Collection ActionListener issue

Status: work in progress
JDeveloper: 11.1.1.1.0
WebLogic: 10.3.1

Issue

Create simple Fusion Web Application as follows:

  1. Create readonly VO in the Business Layer on a table with > 20,000 records and expose it through an AM
  2. Create simple JSPX in the ViewController project
  3. Generate readonly table on a PanelCollection by drag and drop from the data control palette
  4. Create a command button with ExportCollectionActionListener (type="excelHTML" and exportId="<id of the table component>")
    Example:
    <af:panelCollection id="pc1">
    <f:facet name="menus"/>
    <f:facet name="toolbar">
    <af:toolbar id="t2" flex="1">
    <af:commandToolbarButton text="Test here: Excel Export"
    id="ctb1">
    <af:exportCollectionActionListener type="excelHTML"
    exportedId="t1"/>
    </af:commandToolbarButton>
    </af:toolbar>
    </f:facet>
    <f:facet name="statusbar"/>
    <af:table id="t1" ....
    </af:table>
    </af:panelCollection>

Now observe the memory consumption of the WLS

  1. Run the web application
  2. View the Memory consumtion of WLS process: ca 400MB
  3. Click the export to Excel button.
  4. View the Memory consumtion of WLS process: ca 740MB
  5. Undeploy the application
  6. View the Memory consumtion of WLS process: ca 740MB
Observations
  1. A single export of 20,000 records consumes ca. 340MB
  2. It seems there is a memory leak because the memory consumption remains after undeployment.
  3. Same result on Windows XP and Oracle Enterprise Linux 5.3(32bit)
Question

So why the export functionality consumes so much RAM?
Is there a memory leak? How to workaround?

Solution

Still in progress..in cooperation with Oracle Support… will be updated here.

Proposal

In order to be more flexible and powerful it would be great to be able to implement own Exporter implementations, e.g.

<af:exportCollectionActionListener type="excelHTML" exportedId="t1"
exporterClass="com.company.fusionapp.export.MyExcelExporter"/>

or even better (like custom conveter concept)

<af:exportCollectionActionListener type="excelHTML" exportedId="t1" exporterId="myExporter" />

and in adfc-config.xml:

<exporter id="myExporter" class="com.company.fusionapp.export.MyExcelExporter"/>

Sunday, August 2, 2009

ADF: Text resource issue

Status: Resolved
JDeveloper: 11.1.1.1.0
WebLogic: 10.3.1

Last week I came accross a cool blog about ADF BUGS FACTS. The author inspired me to write myself about similiar experiences with ADF11/JDeveloper. So today I will describe a bug concerning the i18n capabilities in ADF11.

First I have to mention tha the support for i18n text resources improved very well with JDev11 but there is a case when things do not work correctly. So in the case your ViewController project name contains a dash. things do not work anymore as expected. So in our company we have following convention to name our applications/projects.

customer-app
      app-model
      app-webui

With that convention your not able to work with the “select text resource” feature on ADF Faces Pages, because invalid code is generated. So here is the example

jdev11_i18n_bug-1024x640Because the ViewController project is called myapp-ui you get the following buggy code

jdev11_i18n_bug2

Solution

Solution is to remove the dash in c:set and of course all EL references.

<c:set var="myappuiBundle"
     value="#{adfBundle['de.team.training.i18n.myapp-uiBundle']}"/>

and

<af:outputText value="#{myappuiBundle.MY_APPLICATION_TITLE}" id="ot1"/>

After this fix the text resource is resolved correctly

jdev11_i18n_bug3


Things learned

Don’t: use dashes (-) in project names! This may cause trouble in development of fusion web applications.

Related posts

Page Fragment Design view is messed up when using resource bundle

Comment from Milkbird: Thanks for your reference Andreas. I think this is realy usefull, since someone could loose a lot of time to find out what is wrong and how to fix it.