Saturday, March 17, 2012

SDO web service from business components validations.

This issue was found by my colleague and friend Gabriel Sideras that was assigned the task to create web services from our business components.
He noticed that sometimes the entity validations was not executed from the web service. This happens when the entity primary key has checked the attribute refresh after insert.
This is reproduced at the attached test case that a simple createDepartment web service is created with HR department entity and view.



If you run the web service in Analyser and Send a request without any data then the entity validations are performed and JBO validation errors are shown in the response:


Yet if you change the DepartmentId attribute of entity which is the primary key and it is filled by a database trigger to be Refresh after Insert and you run the WS again then if you Send a request without any data the entity validations are not executed and the error that is shown is the dml failure from database.


This is a serious issue for us since we try to reuse (at least) the entities of our application to expose web services so this would require changes of implementation of primary keys.

It reproduce in jdeveloper 11.1.1.4 and 11.1.1.6.