- Test a Read Function and Simple Update This page last changed on Nov 29, 2008. .stickable, h1, h2, h3, h4, h5 false true Show Sticky notes Hide Sticky notes Save Cancel Oracle Data Service Integrator Documentation > Data Services Developer's Guide # How To Test a Read Function and Simple Update This topic describes how to test any Read function in an entity data service (either logical or physical) in Test view. Adjust Settings Run the Read Function Perform a Simple Update See Also ## Adjust Settings A read function fetches data. A physical or logical data service usually has at least one read function. You can test a read function with either sample data or real-time data, from the Test tab in Workshop for WebLogic. Testing a read function ensures that: You can read data from the physical data sources. The returned data has the structure you want, especially for a logical data service. The query performs well. The returned data is displayed in the Test tab. ##### Checking the Data Returned by a Read Function When you test a read function, Workshop for WebLogic deploys the service to the server if it is not yet deployed, or if it has changed since it was last deployed. A read function allows you to specify various settings. ##### Settings You Can Change for the Read Function You might want to test with a smaller result set. Select Limit Elements in Array Results To to limit the result to a specific number of elements of the return type, to specific child elements in the return type, or both. Use Start Client Transaction to query multiple relational sources using XA transaction drivers (if selected, Oracle Data Service Integrator uses the Required transaction mode to query data sources; if not, Oracle Data Service Integrator uses the NonSupported EJB transaction method). ## Run the Read Function A read function optionally can have parameters. It is quite common for a read function to have no parameters, with a name something like read() or ADDRESS(). If you are working with a logical service, the update map must be completely enabled before you can run a read function in Test view. If the update map has yellow update blocks or disabled procedures , you must resolve them before you can test a Read function. To test a Read function: Open an entity data service in Workshop for WebLogic. Click the Test tab. At Select Operation, choose the name of the read function you want to test. Expand the Settings tab. Choose values for Limit Elements in Array Results To, Start Client Transaction, and Use Default Authentication. Click Run. If the results are correct, you see this: . You can now click Tree, Text, or Tabular to inspect the returned data. ## Perform a Simple Update The easiest way to test that you can update a data source is to use the Edit and Submit buttons in Test view. Before you test an update, be sure that: The service has a primary update procedure. You can check this by right-clicking an update procedure in the Overview tab and making sure Primary is selected. You can also check for isPrimary="true" in the procedure's pragma statement in the Source tab, for example:
      (::pragma  function <f:function kind="update" visibility="public" isPrimary="true" xmlns:f="urn:annotations.ld.bea.com"> ... ::)
2. The update map is fully enabled for a logical entity service that has an update map. If the update map is not, see Recognize When Something is Wrong. If you are updating a logical data service, you are actually testing an update map. The update will work on any underlying data sources that you have permission to update. To update data after running a Read function: Click Edit, and edit the field you choose. Click Submit. If the data is submitted correctly, you see this message:
       The data has been submitted.
## See Also ##### Concepts Recognize When Something is Wrong ##### How Tos Test an Update Procedure Enable Optimistic Locking

Document generated by Confluence on Jan 13, 2009 15:57