Wednesday, April 21, 2010

What is DataBindings.cpx file in ADF

In ADF web application as soon as you drop a databound component on your page a DataBindigs.cpx file gets created. You may wonder what it contains? So, here it is:

 

The DataBindings.cpx keeps track of the individual page definitions files used within the project, as well as the DataControls mapping to such things as ADF Business Components Application Modules.

 

Till Jdeveloper 10.1.3 release there was no way to have multiple DataBindings.cpx files which was very much desirable as the project the size grows and being worked by multiple teams. Jdeveloper 11g added this capability to have multiple DataBindings.cpx files.

 

There is a new file in 11g called adfm.xml which is used to keep track of all such DataBindings.cpx files in the system. So, when breaking your DataBindings.cpx you need to take care to create an entry in the adfm.xml. You also need to make sure to have unique application id attribute value for each entry.

 

Using Groovy to populate sequence value in primary key attribute in ADF 11g

In ADF 11g there is a better and much simpler way to populated primary key attribute of your entity using a db sequence.

 

You can simply to to your entity pk attribute change the default value type to expression and put



(new oracle.jbo.server.SequenceImpl("YOUR_SEQ_NAME",object.getDBTransaction())).getSequenceNumber()

 

Difference between getRowCount and getEstimatedRowCount in ADFount

In ADF applications where a VO is working on large amount of data it is could be a bad impact on using getRowCount to find the number of rows in the VO. The reason is it query the database table every time it is used. So, it incurs you a DB trip.

 

However, getEstimatedRowCount is a bit different. For the first time it queries to DB table using a select * from table query and store the count in the Middle-tier. After that it keeps on adjusting the count within the middle tier whenever row insertion or deletion are performed on the view object.

 

This way it prevents the db trip and is much faster.

 

The downside of this method is it may not be accurate sometimes. Specially, in the scenarios where there are possibilities of data insertion or deletion from backend by some other application at the same time.

 

Deploying ADF 11g application in weblogic 10.3

 

Today, I was trying to deploy my ADF 11g web application to a weblogic server. So the first step was to right click on View Controller project and go to deploy option. This created a war file for me as npe.war . I went to weblogic console and in the deployments choose install option and provided the path of npe.war. After few next next and finish I saw an error saying:

java.lang.ClassNotFoundException: oracle.adf.library.webapp.ResourceServlet

So, on hunting for a solution finally found that I used the wrong way of deployment. Instead of deploying View-Controller project as a war file I should have deployed the whole application as an ear file. So to do so there is an application menu in the jdeveloper. Select deploy option from there and choose deploy to ear file. So far so good I went again to the weblogic console deleted the old npe.war web app and this time installed npe.ear. After reaching the finish step on hitting finish I saw a new set of errors saying:

java.security.PrivilegedActionException: wenlogic.common.ResourceException:
java.security.PrivilegedActionException: wenlogic.common.ResourceException:
No credential mapper entry found for password indirection user=system for data source NPE

So, another hunt on web resulted into another change I need to do before deploying the app as an ear. To avoid this error you need to go to Application --> Application properties and in the new window uncheck Auto Generate and synchronize weblogic-jdbc.xml Descriptors during deployment.

That's it.. now deploying the ear this time should successful. Please comment if you found any other issues while deploying your ADF application to weblogic.

Dare to Code... : Fine tuning your Application Module in ADF

Abdoul Rahman has sent you a link to a blog:



Blog: Dare to Code...
Post: Fine tuning your Application Module in ADF
Link: http://adfjsf.blogspot.com/2009/09/fine-tuning-your-application-module-in.html

--
Powered by Blogger
http://www.blogger.com/