We have a ViewLink in the Application Module.
i) AddressType - Parent ViewObject
ii)Address Detail - Child ViewObject
iii) There are other View Objects as well in the Application Module
When user selects the Address type the detail Address needs to be displayed.
The Parent View Object (Source View Object) is part of the AM data model. During activation other view objects are getting activated without any issues. However the Child View Object or Destination View Object which is a part of the ParentViewObject is causing the following issues during Activation:
While submitting UI page, there is server side validation (in the App Module Impl class) and during validation (at RuntTime), the Application Module Impl class is trying to get a currentRow
(getCurrentRow()) from Child (Destination) View Object however it is throwing a NullPointerException
The code which trhows Exception is ---> Row currentRow = addrDetailViewObj.getCurrentRow(); //Please note addrDetailViewObj is NOT Null howeve the currentRow is coming as NULL
In order to reproduce the above scenario I have kept the AM pooling OFF. With AM pooling ON i am unable to reproduce any of the above issues.
Please let me know if any extra property settings or coding required in order to activate the Child (Destination) view object.
Edited by: user5396188 on Feb 27, 2012 10:02 PM
Edited by: user5396188 on Feb 27, 2012 10:06 PM
Thanks for the quick response. I will try your solution, I just wanted to know During Pooling OFF - why does it behave like that? However during Pooling ON it is working fine without any issues.
I found this exception even in other App Module as well where we have ViewLink. For the regular View Object (no master/child relationship) it works fine with Pooling OFF.
Edited by: user5396188 on Feb 28, 2012 2:57 AM
Edited by: user5396188 on Feb 28, 2012 2:58 AM
When you work with am pooling off, the state of the am should be written into the db (ps_txn). However, there are some states (like the current row) which is not written into the db (in some versions of jdev). So when the am gets activated there is no current row and you get a NPE in your code (addrDetailViewObj.getCurrentRow();).
The only workaround I know is to store the key of the current row when you get passivated and when you get activated set it again.
Check http://tompeez.wordpress.com/2011/07/08/jdev-always-test-your-app-with-applicationmodule-pooling-turned-off/ for more info.
Thanks Timo. I viewed the link however I do not have any session specific user data used by either ViewLink or our Application Code. Also the relationship between source and destination viewobjects in ViewLink is static and there is no dynamic bind variable being passed.
I just wanted to know is there any limitation in Oracle ADF for ViewLink while Activation and Passivation? We are using Oracle ADF JDev 126.96.36.199.0
Edited by: user5396188 on Feb 28, 2012 10:14 PM