Refresh Metadata for Relational Database (RDBMS) Object Services
The RBDMS Object service is enhanced to support the Refresh Metadata feature in Fabric Console from Fabric V9SP 7 GA onwards. This feature allows app developers to fetch the latest metadata from the database and display the same in the Fabric service.
This feature is available only for Integration and Object Services of Relational Database (RDBMS). Refer to Refresh Metadata for RDBMS Integration Services.
The following sections help you with more details on the uses of refresh metadata for RDBMS Object Services:
Use Case
When a customer changes the metadata directly in the database, there is no way to reflect those changes in Fabric Console. As of now, the entity metadata is only fetched and stored when you create an RDBMS service, and the saved entity metadata may not be relevant in the following cases:
-
Suppose the base infinity app with an RDBMS service endpoint is changed to point to a new database type. Here the entire schema must be the same in both RDBMS instances.
-
If the current RDBMS endpoint database tables are altered
You can get the latest metadata modified in the database using the Refresh Metadata feature. For example, you can refresh the metadata for objects and fields or new endpoint updates. The Fabric console updates the common mappings and verb mappings. And this includes the request and response mappings for XML/Visual mappers, entity properties, and relationships based on the refreshed metadata (not applicable to locked object services.
NOTE: The Refresh Metadata feature updates only the data model objects and fields, not the backend objects/operations from the RDBMS endpoint.
You can access this feature on the Data Model page of an object service pe RDBMS.
User Scenarios - Refresh Metadata for RDBMS Object Services
The following sections help you with more details on different scenarios of Refresh Metadata:
When you try to change the service endpoint URL from one database to another, you need to refresh all objects to get metadata from the new database.
-
In Fabric Console, open the Object Service for RDBMS, for which you want to change database connection parameters, for example, ORACLE endpoint URL, username, and password.
-
Change the new endpoint URL and details on the Service Designer page. For example, MS SQL Server.
NOTE: Ensure that schema in both RDMBS instances is the same. Else the correct data is not retrieved when you perform CRUD operations for this service.
-
Click SAVE & ADD OPERATION. The following pop-up warns you about the DB URL changes.
-
Click OK.
-
Select all objects on the Data Model page and click the Refresh Metadata button. The following alert message is displayed.
-
Click OK to confirm the changes.
You can see the latest objects metadata is updated in your console, including the mapping for common mapping and verb mapping. Ensure to remap before you publish the app for new data.
The runtime server considers only the latest metadata from the database. To effect the runtime changes, you need to republish the app.
When you make changes to the database, you need to refresh objects to get the latest metadata.
-
Create an Object Service of Relations Database endpoint type. For more details, refer to Creating and Object Service.
-
Make changes in the database, such as adding a table, deleting a column, or modifying a column in the table. This database should be part of your RDBMS Object service in your app.
NOTE: Ensure this database is part of your RDBMS Object service in your app.
-
In Fabric Console, open the Object Service.
-
Click on the Refresh Metadata option in the Fabric console. For multiple objects, select the check boxes and click the Refresh Metadata button.
You can see that all the existing objects and fields are replaced with the correct database metadata.
-
Data Model metadata is updated for the latest objects fields with datatypes
-
Object Common Mapping metadata is updated based on the new data model, for example, common mappings mappers (Visual Mapper, XML mapper in request and response mappers) and verb mapping in Object service.
-
Object Verbs base mappers are updated based on the new data model, for example, security filters, Request Mapping (Visual/ XML mapper) and Response Mapping (Visual/ XML mapper). Ensure to remap before you publish the app for new data.
The runtime server considers only the latest metadata from the database. To effect the runtime changes, you need to republish the app.
NOTE: For locked apps, ensure that you do not modify existing column names, data types, or schema because this causes errors during runtime.
When you add new fields in the database linked to locked apps, you need to refresh objects to get the latest metadata from the database.
-
Create an Object Service of Relations Database endpoint type. For more details, refer to Creating and Object Service.
-
Lock the app.
-
Import the locked app into your Fabric.
-
Make changes in the database, such as adding a column, creating a stored procedure, and creating views.
NOTE: Ensure this database is part of your RDBMS Object service in your locked app.
-
In Fabric Console, navigate to the locked app > Object Services > Data Model page.
-
Click the Refresh Metadata option for the object. For multiple objects, select the check boxes and click the Refresh Metadata button.
-
Now since this is a locked app case, you will be able to see all the original locked mappings are intact.
-
Any new fields added by the user will now come under the extensibility feature and are visible in the Fabric Console. And the newly added fields will be updated in common mappings.
-
The runtime server considers only the latest metadata from the database. To effect the runtime changes, you need to republish the app.