Servoy Best Practice w/ ACID Database Featuress

Hi,

I’m still quite new to Servoy and have 2 groups of questions about best practices related to ACID database features.


I assume for mission-critical Servoy applications people are using as many of the data-integrity features as their RDBMS may offer? Examples: foreign key constraints, cascading deletes and updates, transactions, row-locking, etc., and for performance also creating indexes where appropriate.

For the DDL examples (ie: ADD CONSTRAINT) in the list above, these features are added to the databases after they are created with Servoy with other tools? Ie: Servoy does none of this for you?

What is the preferred way to deal with errors like foreign key constraint failures returned by the RDBMS; getExceptionMessage?


The Help states, “By default, Servoy does no locking and no transactions”. Does this mean that to achieve locking and transactions people are writing methods for each form around events like onRecordEditStart, onRecordSave, and onRecordSelection?

Is the above typically done even on simple Forms with default controllers which don’t use more complex options like getDataSetByQuery(), etc.?


Thanks very much for any thoughts/guidance. Cheers.

You can indeed use Servoy’s events to trigger locking and transactions. Whether you use them or not or in a limited way depends on your preferences and what software you are developing with it. Personally I try to limit usage of locking and transactions to only where necessary to avoid all the unnecessary overhead.
The same counts for data-integrity rules you implement. If also external systems access the same data it might be a good idea to implement them on the database side. If only Servoy accesses the data it’s easier to implement them in Servoy. Servoy has a function to retrieve the last database error that occurred, it’s called getLastDatabaseMessagae under the Database Manager object.

Servoy does not auto generate referential integrity DDL for you. You will have to generate that using your modeling tool or you can execute the DDL directly on your backend database.

Thanks for the details, Jan.

Cheers.