Thursday, January 26, 2012

ADF State Management(Activation Passivation ) to un supported databases

ADF by default supports passivation to a database if the database is oracle. ADF out of the box also supports passivation to a database if the database is DB2 or SQLServer. If any other database is used, State management is done to a file.


Though state management to a file is faster than a database. Persisting to a file does not work well in a clustered application. You will notice a major problems when the application fails over.


To address this situation to use unsupported databases and want to use state management against a database

  1.  Create a  CustomPersistManager class that extends oracle.jbo.pcoll.JDBCPersistManager
    for e.g. refer CustomPersistManager.java
  2. Edit the AM Configurations

    jbo.passivationstore:    database
    jbo.pcoll.mgr:    rohith.custom.CustomPersistManager
    jbo.server.internal_connection: use complete jndi like java:comp/env/jdbc/cnTPSDS
                                                       or jdbc url

You might want to add  "-Djbo.passivationstore=database" to the JVM start params to keep this more stable.