update behavior on an external database

update behavior on an external database

  

When you set up an extension to connect to an external database , it seems that the update behavior is set to "all attributes" and its disabled. Is there a way I can change it to "changed attributes" ? Somewhere in integration studio maybe?

I noticed that the supports nulls checkbox is also disabled , however you can change that in integration studio via the "default value behavior" setting. Is there something similar for update behavior?

I would guess that because it's an external database, these settings don't really apply.  It's the external database that would control "supports nulls"... not OutSystems.  I think these settings are justing showing their default values... and are disabled... because they don't apply.

Hi Davidk,

"Supports nulls" is a flag that does change the OutSystems platform behavior. Check https://success.outsystems.com/Documentation/10/Reference/Data/Modeling_Data/Entity.


Mark,

Unfortunately, I don't know the answer to "can you have changed attributes only on external entities?".


João Santos wrote:

Hi Davidk,

"Supports nulls" is a flag that does change the OutSystems platform behavior. Check https://success.outsystems.com/Documentation/10/Reference/Data/Modeling_Data/Entity.


Mark,

Unfortunately, I don't know the answer to "can you have changed attributes only on external entities?".


Really new to all this... but doesn't Support Nulls only apply to OutSystems Cloud Entities... and not External Tables?  Since that setting is disabled for an External Entity, I felt it's setting would not override the External Table setting.


Thanks for the responses guys. Davidk, you can see for yourself that that you can toggle the supports nulls checkbox. Just change the setting "default value behavior setting" in integration studio. 


If you look at the advanced settings of a internal native entity, the supports nulls check box is not even there. It only applies to external entities. Unfortunately it appears I can't change the other setting to "changed attributes". At least I never found a way.

Ok... thanks Mark... I didn't see that connection.  Changing the "default value behaviour" setting in Integration Studio is what changes the Support Nulls value.  Support Nulls is still disabled... but it's value changes based on Integration Studio.  Sorry for the side-track.

I wonder if there is a way to test the Update Behavior setting for an External Database?

The question is... does that setting actually apply... are all Attributes actually updated?

Oh it does. Thats the whole reason for my post.

In my opinion , updating the whole record regardless of what fields have been edited increase the chances of a conflict by a lot. In our application/work flow it is very unlikely 2 users would edit the same field at the same time. However they could and did edit the same record at the same time causing data to be clobbered.


I know there are other things I can do, I just thought this would be the easiest most sensible way to prevent that.

Solution

Hello Mark,

All the options in Advanced (exception to Show Tenant Identifier) are disabled when you are looking to the entity from a CONSUMER module. You can change those options only in the entity from inside the original module.

Regarding External Entities, the option Update Behavior is not available.

Regarding conflict on update when two users update at the same time, afaik this is not possible, at least inside OutSystems, as an Update operation blocks the entire record for reading/write. 

So, in case two persons are trying to update a record, when the entire record is being updated (default modus), the last update operation will have its "version" updated in the database, eventually overwriting data changed by other user previously.

Unfortunately there is no option in Integration Studio to "enable" this behavior (Only Changed Attributes) for external entities. 

A workaround, but one that would require some effort, would be to create SQL that through input parameters define what should be updated... But, like I said, a lot of effort imho.

Cheers.

Solution

Eduardo Jauch wrote:

Hello Mark,

All the options in Advanced (exception to Show Tenant Identifier) are disabled when you are looking to the entity from a CONSUMER module. You can change those options only in the entity from inside the original module.

Regarding External Entities, the option Update Behavior is not available.

Regarding conflict on update when two users update at the same time, afaik this is not possible, at least inside OutSystems, as an Update operation blocks the entire record for reading/write. 

So, in case two persons are trying to update a record, when the entire record is being updated (default modus), the last update operation will have its "version" updated in the database, eventually overwriting data changed by other user previously.

Unfortunately there is no option in Integration Studio to "enable" this behavior (Only Changed Attributes) for external entities. 

A workaround, but one that would require some effort, would be to create SQL that through input parameters define what should be updated... But, like I said, a lot of effort imho.

Cheers.


Hi Eduardo. Thank you for confirming. I was already considering writing my own sql with input parameters, I was just hoping to avoid the extra work.