Rollbase Schema exposed through DataDirect Cloud is not bein

Posted by Bill Wood on 04-Oct-2013 12:34

Problem: I am trying to access my Rollbase application from a JDBC client, using DataDirect Cloud.   I have configured Rollbase as a DataSource in my D2C account, and I can query or update my Rollbase schema.   The problem is that if I change my Object in Rollbase, the schema does not seem to be updated.

This may be OK for  adding fields (assuming I don't need them in my JDBC client), but not for deleted or renamed fields.

(now I am going to answer this myself, because I did track this down and I wanted to share the result.)

Answer:  DataDirect Cloud drivers are ways of accessing cloud data sources that are not 'real' SQL databases, as if they are SQL.  Architecturally, DataDirect Cloud queries the schema first when the data source is created. There is no mechanism for cloud datasources to notify DataDirect Cloud of schema changes.

DataDirect Cloud could poll for new schemas, but if the schema never changes (which is the common case after the application is complete) this will just be inefficient and affect performance.

Since retrieving the metadata and building the map of the relational model from the backend object model is an expensive operation, the drivers do not do this by default. 

There are two ways to force the drivers to rebuild the map. 

  1. The first mechanism is to issue a command to refresh the schema.  For Salesforce, it would be REFRESH SCHEMA SFORCE and for Rollbase it would be REFRESH SCHEMA ROLLBASE 

  2. The other way to have the driver rebuild the relational map is using the Create Mapping configuration parameter when creating the data source.  If you set Create Mapping to "Force New", this causes the driver to rebuild the relational map every time that the application connects to the data source.  The drawback to this is that your application will incur the overhead of having to rebuild the relational map every time you connect.

All Replies

Posted by Bill Wood on 04-Oct-2013 12:38

As another comment, it would be a Best Practice to  set the "Force New" option on the mapping when you are actively developing your Rollbase application, and when you are constantly modifying Objects and Fields.  Conversely, when you deploy the application and it has stabilized the schema, turn this off.

If you are not simultaneously building the Rollbase application, and the remote JDBC client, then the DataDirect Cloud defaults are fine.

Posted by Bill Wood on 15-Oct-2013 07:44

The following suggestion is a good way to force the connection Meta-Data to refresh when the Connection is open.  (Java calls to JDBC 'getTables()' may have not always cause the "Force New" option to fire.)

Modify the DDC data source to put REFRESH SCHEMA Rollbase in the InitializationString.  After doing this, any request will execute this command on Rollbase when the connection is opened .  

CAVEATS:
The side effect is that the relational map within the driver is rebuilt every time a connection is established.  That resolves this issue, but there is still the possibility that the schema can be changed after you have connected.  In this case, the driver's relational map will not reflect the change made to the schema by a connection through a different data source.

This thread is closed