Friday, June 26, 2009

Oracle ADF and International Characters

My team is developing application in Oracle ADF with internationalization support. When we did preliminary tests, we have noticed that we can't save local characters to database, entered characters simply were transformed to code representation. Our database character set is not UTF-8, but local. We were lucky to find very elegant solution - just to change content type charset of our pages. We have changed it to UTF-8, inside our JSPX pages, and ADF automatically transforms it to database character set. This means, same approach works when we have UTF-8 charset in database, or any local charset as well.

You can download my sample application -, where you can test how it works on your database.

Let's say we have simple form:

And type text in local language for First Name field, this time in Russian. When user will want to store this record and will invoke Commit, local language characters will be transformed to unreadable form by default:

I saw people are asking related questions quite frequently on OTN forums. Actually solution is simple, we just need to change page content type charset from default one:

To UTF-8 charset:

This will allow to accept local characters on JSPX page and to transfer them through ADF Business Components to database. And now Russian text is saved to database without problems:

And if to check database, here is this text stored:

Finally, its important to mention, that if your database is installed with UTF-8 support, you can store all local characters. But, if you have database with specific character set, you can store only this specific charset from JSPX pages. Its good thing you dont need to modify your JSPX pages in both cases, just declare UTF-8 for page charset encoding. My database is installed with UTF-8 charset:

Friday, June 19, 2009

Quick Hint for ADF Faces Rich Client Performance Tuning

In this post I want to write about quick hint applicable for ADF Faces Rich Client performance tuning. This hint was found by my colleague - Sasha Stojanovich, we are working in the same project. I think it will be useful for community as well.

We have discovered, that we can disable ADF Faces Rich Client animation functionality globally, just by adding one line in trinidad-config.xml file:
  • animation-enabled = false
If you really don't need animation effect, this will help greatly when rendering LOV popups, drawing data tables and etc. By disabling animation, artificial delay of components rendering is removed and this allows to achieve better UI performance.

Thursday, June 18, 2009

Oracle OpenWorld San Francisco 2009

My paper for Oracle OpenWorld 2009 - Oracle JDeveloper/Oracle Application Development Framework 11g Production Project Experience is accepted !

Session ID#: S307721 abstract:

This session, based on practical experience in Oracle JDeveloper/Oracle Application Development Framework (Oracle ADF) 11g technology, describes development best practices for J2EE development with Oracle ADF Business components, Oracle ADF Task Flows, and Oracle ADF Faces Rich Client. The speaker focuses on technical aspects of his work and demos an Oracle JDeveloper 11g quality extension his team created. It implements Oracle ADF 11g development best practices for Model-View-Controller parts as a set of rules applied to Oracle Fusion. The speaker also describes how his team is using the Oracle JDeveloper 11g Subversion (SVN) client for team development with SVN branches.

I will be happy to see you there on Oracle Develop: Oracle Fusion Development track in San Francisco this October !

Saturday, June 13, 2009

Working with View Criteria Items

I will describe how you can work with view criteria items in easy way. Often when you will use Oracle search component - af:query, you may face requirement to access entered criteria items and perform one or another action based on the result. I would like to recommend always base view criteria items on Bind Variables, this will greatly help you while working with query pages.

Download developed sample application - In this sample I'm accessing entered criteria item values and based on this show or hiding result components.

As I already have mentioned, I have declared view criteria based on Bind Variables:

In View layer I have overridden Query Listener (more: ADF Query Component and View Criteria Functionality with Custom Query Listener in 11g):

I'm accessing view criteria items directly in overridden Query Listener. I can do this by getting Bind Variable values from VO Variable Manager. Here is a power of defining View Criteria on Bind Variables, not just Literals. Sample code where I'm accessing criteria values and showing/hiding result components on the page:

On runtime, when page from my sample application is rendered, user will see just View Criteria available:

According to implemented logic, if user will enter First Name criteria and will do search, table component with results data will be present:

If user will enter both criteria parameters - Firs Name and Last Name, this means instead of table, form component will be rendered:

Saturday, June 6, 2009

JDeveloper 11g IDE Performance Problem - Reproduced

2009/06/08 UPDATE: I got answer from Oracle, this problem is not reproduced anymore in their internal latest build.

2009/06/12 UPDATE: Additional Helpful workaround was posted on From Developers To Developers blog.

Our team have reproduced performance problem in JDeveloper 11g IDE while developing ADF applications. This problem seems so big, that it can crash JDeveloper 11g in 5 minutes by returning 'Low Memory Message'. In this post I will describe how to reproduce IDE performance problem and will provide sample application as test case. You can reproduce bug in latest JDeveloper 11g release - Build JDEVADF_MAIN.BOXER_GENERIC_090328.0229.5205. It was logged on Metalink in November 2008, but not fixed still (BUG 7601410).

You can download developed sample test case where you can reproduce 'Low Memory Message' in 5 minutes - Sample is really simple, it contains ADF BC from HR schema and one JSPX page, one entry in DataBindings.cpx.

When opening application in JDeveloper 11g, in the beginning IDE behaves normally, it consumes just as usual around 300 MB:

Here is structure of sample application, really nothing complex:

Nothing complex except two property bundle files - and Those files contain around 1000 entries each, and you will see now what problems it creates. Im using couple of entries from those files in main.jspx and just by opening this page I'm getting doubled memory usage up to around 800 MB:

I have tried to open just one Expression Builder on main.jspx:

And I got 1200 MB used in 3 minutes:

Same time I got 'Low Memory Message' in JDeveloper 11g IDE:

The reason for this is large property bundle files and how those files are referenced from JSPX page. When developer puts label from property file on the page, JDeveloper automatically creates following references:

Those references cause JDeveloper 11g IDE to consume memory heavily and run out of memory, especially when property bundle files are big.

If you will comment property bundle files referencing:

JDeveloper 11g IDE will behave as expected, without high memory usage:

I wish described IDE performance bug will be addressed and fixed in next JDeveloper 11g release.

Spanish Summary:

En este capitulo, Andrejus identifica un problema de rendimiento en la herramienta JDeveloper 11g. Se muestra un ejemplo que al ser ejecutada con la herramienta tiene un alto consumo de memoria. Afortunadamente, Andrejus ha enviado a ORACLE sus descubrimientos para una pronta soluciĆ³n del problema.