Pages

Thursday, May 15, 2014

Activation and passivation will not happens

In Connection with my previous post Activation and passivation in ADF
 
If you uncheck following flag means
1.Enable Application module pooling
2.passivate state and Include All transient Values.
passivation wont happens.there is no active record to activate. i.e activation/passivation wont happens
then re-run your application.

then result would be.

Step 1: After Un-check flag. re-running the existing application.
enter the data press submit.




Step 2: Log shows that after each request application module & jdbc connection created and closed.

while Observing when creating a record a 
**insert** id =1,parid=1,collid=98312,...

Notice one more thing "delete all" collid=98311
collid is field of an PS_TXN table.delete "PS_TXN" where collid =:1


Finally at this end. no passivation store happens, so while activation no record fetching takes places.


 

Download here.

Note: Before running this application un-check the concern flag. "Activation and passivation will not happens"

Activation and passivation in ADF

Here we go with an sample application how activation/passivation works. I'm having application constructed with help of transient view object in model layer.

Step 1: Enable Application Module Pooling.



By default flag checked. with the help of this flag activation/passivation will happens.


Step 2: Creation of transient view object



Step 3: Checking all transient attribute for performing passivation.



if you do the step2 means all value all those attributes in this transient viewobject will be passivated.

Step 4: All attributes passivate flag is checked. 



Note : if you dont want to passivate all attributes in an viewobject means don't check "Including All Transient Values"

you can able to passivate the transient needed individual attribute.
see the following figure.




That's all now activation/passivation will handle by the framework by default.
It will works upon Application Module Connection pooling parameters.

Step 5: Same Transient View objects instance shared in two jspx pages one as af: form and another one as af:table.

Step 6: for debugging use this -Djbo.debugoutput=console
DC Instantiation happening.




Loading BC4J default properties and as previous blog told that       PS_TXN creation.                                              

 
Additional logs.                                                                                                                                                                    

Step 7: After pressing create insert button.



Along with its log. 



Step 8:  After Submit the data to server.



Along with its log.




Step 8: Go to next View page.



 Finally record passivate gets activated.



Download here

Application Module Pooling in ADF

Here I got a time to share a few things. Now days, one of the basic interview question in application module is what is application module pooling.

Oracle documentation says that,  "An application module pool is a collection application module instances of the same type."

While speaking application module pooling, activation and passivation comes into the picture.
 
Say as an e.g: If an application module pool has 5 application module instance. All of the application module instance are occupied. 4 instance are occupied and servicing their request. one instance is occupied. but user is in idle state.

Now this time a new user performing a request means application module pool check for application module instance Is there any idle.? 

If so, suddenly scan the user session data into insert into PS_TXN table. This store mechanism is called passivation. Now new user can utilizes the application module instance.

When idle user resume his work, framework will automatically retrieve his own data.
id will be handled at PS_TXN table level and Session Management too.

In below figure you can see the PS_TXN table.