Switching DB connection for screen aggregates
Application Type
Reactive

Hi

We recently started implementing database switching for one of our applications.

I am looking into exactly when the connection needs to be switched in order to always fetch data from the correct DB. For normal server actions we will be switching the connection at the start of the action as specified in the documentation. My question is how do we handle screen aggregates? The screen aggregates run asynchronously at the start of the page and we therefore have not switched the DB. Is there an easy way to switch first before the aggregates are run, or would we need to make use of Data actions instead?

Solution

Hi Stefan,

I would say managing all in a Data Action is always a better choice. More over, having a Data Action to call all aggregates have better performance than using several screen aggregates.

You can see that on Best Practice Optimize Fetching Server Data for a Screen

https://success.outsystems.com/Documentation/Best_Practices/Development/OutSystems_Mobile_Best_Practices

Hi José,

Thank you for your response. That makes sense to me and will actually work really well with the rest of our architecture

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.