Dynamic ViewObject - Current row key causes error after passivation
Jdev 11.1.1.2.0 and 11.1.1.3.0
I am creating a ViewDefImpl entirely programmatically in an AppModule. The dynamic ViewObject created from the definition works fine until I test with app module pooling disabled to force passivation. Passivation looks fine but when reactivating the ViewObject the current row key cannot be reconstructed and I get a fatal error.
I set the primary key attribute by calling setPrimaryKey(true) on the ViewAttributeDefImpl. It seems like this is working correctly because if I call getKeyAttributeDefs() on the ViewObject prior to passivation, I see the correct view attribute.
Passivation of the key looks fine:
<Key>
<![CDATA[00010000000A30303033383133343734]]>
</Key>
But upon reactivation this error occurs:
<Key><parseBytes> [7252] Key(String, AttributeDef[]): Invalid Key String found. AttributeCount:1 does not match Key attributes
<DCBindingContainer><reportException> [7253] DCBindingContainer.reportException :oracle.jbo.InvalidParamException
<DCBindingContainer><reportException> [7254] oracle.jbo.InvalidParamException: JBO-25006: Value 00010000000A30303033383133343734 passed as parameter String to method Constructor:Key is invalid: {3}.
at oracle.jbo.Key.parseBytes(Key.java:537)
at oracle.jbo.Key.<init>(Key.java:179)
at oracle.jbo.server.IteratorStateHolder.getCurrentRowKey(IteratorStateHolder.java:34)
at oracle.jbo.server.ViewRowSetIteratorImpl.activateIteratorState(ViewRowSetIteratorImpl.java:3877)
at oracle.jbo.server.ViewRowSetIteratorImpl.getRangeSize(ViewRowSetIteratorImpl.java:623)
at oracle.jbo.server.ViewRowSetImpl.getRangeSize(ViewRowSetImpl.java:2808)
at oracle.jbo.server.ViewObjectImpl.getRangeSize(ViewObjectImpl.java:9231)
at oracle.adf.model.binding.DCIteratorBinding.initSourceRSI(DCIteratorBinding.java:1828)
... And I'm dead in the water.
If I do not set any attribute as a primary key, I get the following warning prior to passivation:
<DCIteratorBinding><refresh> [6552] Executing and syncing on IteratorBinding.refresh from :FinalistsWithEvalDataVOIterator
<DCIteratorBinding><getViewObject> [6553] Resolving VO:FinalistsWithEvalDataVO for iterator binding:FinalistsWithEvalDataVOIterator
<DCIteratorBinding><setRangeSizeForRSI> [6554] Changing iterator range size from :1 to :-1
<JUCtrlHierBinding><createRootBinding> [6555] Warning! Binding:FinalistsWithEvalDataVO1 requires key attributes to be able to locate nodes in the hierarchy.
<JUCtrlHierBinding><createRootBinding> [6556] Mark atleast one attribute as a key attribute in the bean or ViewObject definition for each node type in this hierarchy.
... Passivation looks fine with what must be an auto generated key:
<Key>
<![CDATA[0000000001E00000012CEACBFBE5]]>
</Key>
... I get the following warning, but no errors when reactivation occurs:
<ViewObjectImpl><bindParametersForCollection> [7240] Bind params for ViewObject: [FinalistsWithEvalDataVO]AwardViewingServiceAM.FinalistsWithEvalDataVO
<JUCtrlHierNodeBinding><convertRowsToNodes> [7241] Warning! Binding:noCtrl_oracle_adfinternal_view_faces_model_binding_FacesCtrlHierNodeBinding_583 requires key attributes to be able to locate nodes in the hierarchy.
<JUCtrlHierNodeBinding><convertRowsToNodes> [7242] Mark atleast one attribute as a key attribute in the bean or ViewObject definition for each node type in this hierarchy.
<CurrencyRowKeySet><_computeCurrentRowKey> ADFv: Rowkey does not have any primary key attributes. Rowkey: oracle.jbo.Key[], table: oracle.jbo.server.ViewObjectImpl@144b226.
<JUCtrlHierBinding><createRootBinding> [6555] Warning! Binding:FinalistsWithEvalDataVO1 requires key attributes to be able to locate nodes in the hierarchy.
... And the table in my jspx page shows up with the correct number of rows but no data showing.
I assume this is either a bug, or I'm not setting some piece of metadata appropriately on the key attribute.
Currently my ViewDefImpl is not using any entityAttributes, just viewAttributes, but I tried using an entity and got the exact same errors.
Any help would be greatly appreciated.
Thanks.
-Ed