Daily Archives: September 7, 2010

JBO-27024: Failed to validate a row with key oracle.jbo.Key


How to defer the mandatory constraint?

The mandatory validation is a database constraint and you do not have any control over it in ADF. You will not have the validation execution tab for these kind of DB constraint validation if you want to defer it based on some condition.But the Error message can be overridden.

if you want to populate the key attribute for the child from the parent then enable “Composite Association -> Cascade Update Key Attributes” for the association

JBO-27024: Failed to validate a row with key oracle.jbo.Key usually occurs

1. Not providing value for a mandatory attribute.
2. Incorrect value for an attribute of different data type
3. any of your other validation rules failed.

the validation is failing because the id attribute may not be getting created properly. Because of this it could not validate the row as the id is null. row.validateEntity() will help to identify the error by calling it when you commit the record and check where exactly the error pops up.

4. when the primary key is not based on a sequence and depends on the composite. The solution is to create a surrogate key. If you want to override the db constraint you must have a surrogate key populated programmatic way every time a new row is created. So that the data is unique all the time and proceed with a customized error message for each attribute, make the surrogate key hidden and read only.

if you want to suppress the validation then use skipValidation=true in pageDef or have the immediate set to true.

Advertisements

Differentiate services and sid in connection string


This might be a basic information for some experts out there but I felt its worth mentioning it here

how will u differentiate between services and the SID to connect to Oracle using JDBC in the connection string

for SID: it goes like
jdbc:oracle:thin:@localhost:1521:XE

for Services you specify like
jdbc:oracle:thin:@localhost:1521/XE

 Class.forName("oracle.jdbc.driver.OracleDriver");
 conn =
 DriverManager.getConnection(jdbc:oracle:thin:@localhost:1521/XE,system,tiger);
 Statement stmt = conn.createStatement();
 ResultSet rset = stmt.executeQuery(query);

oracle.fabric.common.FabricInvocationException


Bump….
I got this error yesterday when I tried to deploy a dummy soa composite

Error Message: {http://schemas.oracle.com/bpel/extension}remoteFault
Fault ID    default/Project1!3.0*ad3d0394-9602-4482-9429-fc45d624bb5b/ProcessHello/3-BpInv0-BpSeq0.3-3
Fault Time    Sep 3, 2010 1:07:55 PM
Non Recoverable System Fault :
<bpelFault><faultType> <message>0</message></faultType>
<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
<part name="summary">
<summary>oracle.fabric.common.FabricInvocationException</summary>
</part>
<part name="detail"><detail>null</detail></part>
<part name="code"><code>null</code></part>
</remoteFault></bpelFault>

for the above error the solution is the deploy the soa composite along with the deployment plan

right-click the composite and click on generate

when u deploy the soa composite you will have to select the
‘Use the SOA configuration option’ and locate the file

The sample config plan will be like

<?xml version="1.0" encoding="UTF-8"?>
<SOAConfigPlan xmlns:jca="http://platform.integration.oracle/blocks/adapter/fw/metadata" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:orawsp="http://schemas.oracle.com/ws/2006/01/policy" xmlns:edl="http://schemas.oracle.com/events/edl" xmlns="http://schemas.oracle.com/soa/configplan">
 <composite name="Project1">
 <!--Add search and replace rules for the import section of a composite
 Example:
 <searchReplace>
 <search>http://my-dev-server</search>
 <replace>http://my-test-server</replace>
 <searchReplace>
 <searchReplace>
 <search>8888</search>
 <replace>8889</replace>
 <searchReplace>-->
 <import>
 <searchReplace>
 <search/>
 <replace/>
 </searchReplace>
 </import>
 <service name="orderprocessor_client_ep">
 <binding type="ws">
 <attribute name="port">
 <replace>http://xmlns.oracle.com/SOAApplication_jws/Project1/OrderProcessor#wsdl.endpoint(orderprocessor_client_ep/OrderProcessor_pt)</replace>
 </attribute>
 </binding>
 <callback>
 <binding type="ws">
 <attribute name="port">
 <replace>http://xmlns.oracle.com/SOAApplication_jws/Project1/OrderProcessor#wsdl.endpoint(orderprocessor_client_ep/OrderProcessorCallback_pt)</replace>
 </attribute>
 </binding>
 </callback>
 </service>
 <!--Add search and replace rules for the component properties
 For components and service/reference bindings, you can add policy references.
 Example:
 <component name="*">
 <wsp:PolicyReference orawsp:category="management" orawsp:status="enabled" URI="oracle/log_policy"/>
 </component>-->
 <component name="OrderProcessor">
 <property name="activationAgent.LoadData.className">
 oracle.tip.adapter.fw.agent.jca.JCAActivationAgent
 </property>
 <property name="activationAgent.LoadData.portType">
 <replace>execute_ptt</replace>
 </property>
 </component>
 <reference name="StoreFrontService">
 <binding type="ws"/>
 </reference>
 </composite>
 <!--To configure monitor.config:
 <property name="enabled"><replace>true</replace></property>
 <property name="dataObjectsFolder"><searchReplace><search>mydev</search><replace>myproduction</replace></searchReplace></property>

 sample properties to configure for adapter:
 medmq1

 To add search and replace rules for wsdls, xsd and jca files
 Example:
 <searchReplace>
 <search>http://my-dev-server</search>
 <replace>http://my-test-server</replace>
 <searchReplace>
 <searchReplace>
 <search>8888</search>
 <replace>8889</replace>
 <searchReplace>
 -->
 <wsdlAndSchema name="OrderProcessor.wsdl|StoreFront.wsdl|xsd/BPELProcess1.xsd|xsd/OrderProcessor.xsd|xsd/singleString.xsd|xsd/StoreFront.xsd|xsd/StoreFrontProcessor.xsd">
 <searchReplace>
 <search/>
 <replace/>
 </searchReplace>
 </wsdlAndSchema>
</SOAConfigPlan>