Friday, February 17, 2012

Oracle WebCenter 11g and ConcurrentModificationException

I came accross recently a very weird issue on Oracle WebCenter 11g PS4 (11.1.1.5).

I had a page, with four portlets. One of them had a portlet parameter. When I tried to provide a value for that portlet parameter at runtime (using the WebCenter Administrator), i got a ConcurrentModificationException exception. Here is a snippet from the log file:

java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
at java.util.LinkedList$ListItr.next(LinkedList.java:696)
at oracle.portlet.client.containerimpl.event.EventManagerImpl.fireEvent(EventManagerImpl.java:117)

After loggin an SR, this is a known issue and Oracle has a fix for it (patch 10427778).

Wednesday, February 1, 2012

Ensuring that your ADF Application is Passivation/Activation Safe

Hi everyone,

Just a quick note on passivation/activation. ADF works with two pools, Application (via AMs) and Database (via your database connection). Each time a user accesses a resource and that resource uses an AM to display data, the Application Module pool manager assigns an AM instance to the user session. If the pool runs out of connections, the AM pool Manager passivates the state of one of the sessions (either in the database or in a file), thus releasing an instance and assigning it to the new session. When the user that was passivated resumes their work, ADF will activate their state from the configured store. This is done automatically for you for all attributes that are mapped to a database column.

However, for transient attributes and transient views, if you do not mark them to be passivated, their state will be lost, and during activation will be empty. You can test if your ADF application is passivation/activation safe by deselecting the “Enable Application Module Pooling” option in the “Pooling and Scalability” tab of the AM configurations. This will basically force the framework to passivate/activate your session state with every click that you perform.

***NOTE*** Do not forget to enable AM pooling once you have tested your application.

To mark a transient attribute that is part of a normal view to be passivated, you just need to select the “Passivate” attribute on a the view object attribute.



In the case of a transient view (programmatic) though, you need to do a couple of things:

a) Mark the whole view, including all transient attributes to be passivated
b) Make sure that the “No Rows” option is selected in the “Retrieve from the Database” section is selected
c) Override the beforeRollback and afterRollback methods in the ViewObjImpl class by commenting out the call to super.