0% found this document useful (0 votes)
150 views24 pages

Optimizing Entity Joins and Timer Processing

The document provides considerations and recommendations for joining an entity from the local module with an entity from a linked server that has thousands of records. It is not recommended to perform a cross join over linked servers due to performance issues. Instead, it is better to query the entities separately and correlate the results, or pull a minimal subset of data from the linked server using techniques like temporary tables before joining. Committing records and deleting source data in batches can also help avoid timeouts when processing large volumes of records.

Uploaded by

mahesh manchala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views24 pages

Optimizing Entity Joins and Timer Processing

The document provides considerations and recommendations for joining an entity from the local module with an entity from a linked server that has thousands of records. It is not recommended to perform a cross join over linked servers due to performance issues. Instead, it is better to query the entities separately and correlate the results, or pull a minimal subset of data from the linked server using techniques like temporary tables before joining. Committing records and deleting source data in batches can also help avoid timeouts when processing large volumes of records.

Uploaded by

mahesh manchala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

1.

If you need to join an Entity defined in your module (eSpace), with another
Entity from a linked server* (consumed from an Extension), with thousands of
records, what are your considerations?

Instead of doing the join, query the entities separately and than cycle trough the
results to correlate records

It is not possible to make cross joins over linked servers

Use additional logic to pull the minimum subset of data required from the linked
server (temporary tables, OPENQUERY, ...) before performing the join

It's recomended, because the table from the linked server is completely loaded to the
DB Server, before the join is performed

*linked server é uma ponte entre duas bases de dados para que se consiga fazer ligações.
Caso não haja linked server, há erros ao tentar fazer o join de entidades.
2. The following Action is associated to a timer. It generates Traffic lines by
processing highway Readings. After processing, the original readings must be
deleted to avoid being processed again in future runs of the timer.

Given the huge volume of Readings, the timeout is normally reached and new Readings
keep piling up while no Traffic lines are produced as the transaction is aborted upon timeout.
Pick the approach that avoids timeouts (without increasing the timeout duration) and ensures
that the timer eventually processes all Readings, without repeating unnecessary work.

Get only 1000 Readings on each timer run, and make sure to only delete the same
Readings at the end.

Control the execution time of the timer, and stop iterating as soon as the timeout is about to
be reached.

Loop through a configurable portion (batch) of Readings, process them and commit them.
Keep processing new batches controlling the elapsed time and re-wake a new instance of
the same timer if the timeout is about to be reached.

In every iteration of the loop (cycle), commit each Traffic creation and delete each Reading.
3. Integration Studio enables developers to quickly integrate with external databases
using a Database Wizard. Select the correct option.

A developer can import tables and views as Entities.

The developer must map unsupported database data types and establish the relationships
between the imported Entities.

Once the extension is published, a developer can query imported Entities and even join
them with Entities defined in Service Studio.

Once the extension is published, the imported Entities and their data are copied into the
Platform Database.

4. Regarding Web Services, which option is correct?

A Web Service Method can be set as Internal Access Only.

Web Services can be implemented with SSL Security but only with client certificates.

From the consumers perspective, a referenced Server Action executes in the same
transaction and a Web Service Method in a different transaction.

A Web Service Method can be implemented the same way as a Server Action, but
Structures must be used for the output.

5. In Service Studio, you can execute .NET code in actions created in Integration
Studio extensions. Select the correct answer.

You can create actions to call your .NET code in Integration Studio by introspecting your
DLL.

You can import entities from external databases and Integration Studio automatically creates
actions that execute .NET code to manipulate their records.

You can implement your .NET code in an extension using Visual Studio. Actions are created
and mapped to .NET class methods through the <ExtensionName>.cs file.

All answers are correct.


6. The following action processes an Excel file with Traffic Reading rows and inserts
those rows in the Traffic entity. This process frequently aborts due to errors on the
Excel file, and that results in missing data in the Traffic entity.

What improvement ensures that all the correct readings are stored and the wrong
rows are ignored, without aborting the entire operation?

Refactor statements inside the Cycle of the For Each in a new server action which handles
exceptions without aborting the transaction.

Add an Exception Handler to the LoadTraffics action in order to prevent the transaction from
being aborted.

Add an If statement after the GetTollOut aggregate to check if either GetTollIn or GetTollOut
return an empty list and, if that is the case, skip the current reading.

Place all the readings in a temporary table and then call a timer to asynchronously process
those readings with the same For Each loop implementation

7. Consuming an Internal Access Only (or same-network) Web Service instead of


consuming a public action is ...

... admissible to avoid strong coupling and simplify dependencies.

... only admissible to consume a same-network non-OutSystems Web Service.

... recommended since it promotes loose coupling.

... never admissible in any circumstance, and not recommended by OutSystems, since
consuming an action is more efficient.
8. Considering the behavior implemented through the following Database Entities and
relationships, select the correct option.

Customers with Orders are not deletable and deleting an Order Line deletes the associated
Order.

Deleting an order deletes, all associated Order Lines and referential integrity is only
guaranteed between Orders and Customers.

Deleting an Order leaves the associated Order History entries but some Orders are not
deletable.

Referential integrity is guaranteed between Order and Order Line, and Customers with
Orders are not deletable.
9. An Employee List Screen, fed by an Aggregate, is showing 5 out of 30 fields of
Employee entity.

You need to implement a screen for an info balloon that shows an employee Resumed
CV (field with up to 1024 chars) on mouse over the Employee Name.

What would be the best practice for passing the necessary input parameters to the
info balloon screen?

Alternative A because I already got the ResumedCV on the Aggregate.

Alternative B because it avoids querying the employee again.

None of these alternatives. I would rather create a special structure with EmployeeId and
ResumedCV, making that the data type of the screen input parameter.

Alternative C because passing an entity identifier minimizes network traffic.

10. Consider that you aim to develop a Multilingual application. After adding Locales
to the module (eSpace), what do you need to build a Multilingual application?

Use the translation editor to translate all text for each Locale: text, labels, titles and entity
records. Use the built-in Actions SetCurrentLocale and GetCurrentLocale to manage the
Locale in User sessions.

Use the built-in Action GetCurrentLocale to get the translation of a particular language
resource. Use the built-in Action SetCurrentLocale to dynamically change the translation of a
particular language resource.

Add an Entity to manage all the language dependent resources, including Screen titles,
Header captions or Button labels. Use the built-in Action GetCurrentLocale to retrieve the
correct values.

Use the translation editor to translate language resources for each Locale.
Extend entities with a detail Entity to translate language dependent fields, and adapt queries
accordingly.

11. Regarding Roles, select the correct option.


- A Role defined in one module (eSpace) can be used in another module.
- When module MyApp is created, the system Role MyAppUser is automatically created and
can't be deleted.

- System Role Registered is granted to any authenticated user.


- Web Screens and Human Activities can be associated to Roles at runtime.

- Roles are used to design your security policies and associate them with module (eSpace)
elements and end-users.
- Roles can only be associated to users through the Users application.

- Web Screens and Human Activities are some of the module (eSpace) elements that can be
associated to Roles.
- Applications can use GrantRole and RevokeRole Actions to manage Role association to
users.

12. A Site Property is a good choice when one needs to store a global value that is
changed regularly, as long as that value is of a basic or Entity identifier data types.

I don't agree. Site Properties can also be used with values of compound and collection data
types.

I agree. Site Properties avoid using configuration Entities for values that change regularly.

I agree. Changing a Site Property's value is only done at cache level, making it a very fast
operation.

I don't agree. Changing Site Properties values invalidates the module (eSpace) cache, which
is not efficient.

13. A good way to avoid recalculating large information (e.g. 40KB) in every screen
request, is to use the On Session Start System Event and store the calculated result
in a Session Variable to be used in the following requests.

Session Variables should only be used to hold data that change during the session,
regardless of their size.

Since Session Variables are fetched and updated between the Platform Server and the
Platform Database in each request, they are not recommended to hold large information.

It is not possible to create Session Variables of BinaryData data type.

Caching large data in Session Variables will always speed up all the screens that repeatedly
require the same information.
14. Considering the following scenario: coreC.oml consuming appA.oml, appA.oml
consuming appB.oml and appB.oml consuming coreC.oml.

Select the correct option.

Publishing the modules (eSpaces) in Service Studio by the following order: appA.oml, then
coreC.oml, and then appB.oml, will fix all Outdated Consumer warnings.

Publishing a solution will loop forever, since there is a chain reaction caused by circular
dependencies.

Publishing a new version of appA.oml doesn't show any warning to republish coreC.oml.

Publishing a solution is the only way to publish all the modules (eSpaces) without getting
outdated compilation warnings.

15. Regarding pr, which option is correct?

When using cache, all Actions of the same Web Reference need to have the same
expiration timeout.

If the Web Service is deleted or changed, when publishing a module (eSpace) that contains
a corresponding Web Reference, Service Studio displays an error and does not publish.

Both the Web Reference Method and the Screen Actions that invoke it, use the same
transaction.

If the Web Service is deleted or changed, when publishing a module (eSpace) that contains
a corresponding Web Reference, Service Studio displays a warning.
16. Multi-tenancy allows the implementation of a solution for different user domains,
using a single Application Server and Database Server, by:

Isolating the information in multiple catalogs and deploying a different instance of the
application for each Tenant.

Isolating data, end-users, sessions and asynchronous processes per Tenant.

Automatically restricting a user session (logged in with a unique username and a secret
password) to access only information associated with all the Tenants, in which the user is
registered.

Defining which Database Entities are Multi-Tenant and setting in all queries the Tenant
Identifier.

17. Logic inside Screen Actions should not access or use the result of a query defined
in the Preparation. Why is this statement true?

Screen Actions should only be used to validate and submit a Form, so only data from this
Widget should be used in the Action.

The result of the queries in the Preparation are not available in the scope of Screen Actions.

Large chunks of information will be stored in the view state, making the application slower.

It is more efficient to pass the query result from the Preparation to the Screen Action, as an
Input Parameter.
18. Server Action LoadTrafficReadings is called in a Screen Action and processes an
Excel file with Traffic Reading rows. The LoadTrafficReadings Action inserts
calculated entries in Traffic Entity, according to the car weight, entry toll and exit toll.

Due to the amount of readings (around 50 thousand on average) and the number of
queries made in each iteration, a timeout can be obtained losing the computation
done.

Select the alternative that will improve the performance of LoadTrafficReadings


Action and prevent timeouts.

Cache all the queries so that the request doesn't timeout.

Given that GetTollIn and GetTollOut are similar aggregates, create an auxiliary cacheable
action to leverage the possibility of reusing those results twice per iteration.

Place the readings in a temporary table and let a timer, with timeout management, process
the readings asynchronously. Refactor the existing aggregates in a single cacheable action
to reuse the result.

Asynchronously process the readings and transform the three queries inside the For Each
loop into a single cachable query that given the Toll In and Out (without the weight as input),
returns the Car Journey Price, reusing the result for traffic rows with similar journeys.
19. The following SQL Query selects three required attributes from the Question and
QuestionLocale Entities. This query results in a runtime error. Advise on the best
action to fix the error with the best performance.

Remove the existing Entities from the Output Entities / Structures. This way, the SQL Query
is automatically optimized by the platform and only returns the used attributes.

Create a specific Output Structure with the three required attributes, using it to replace the
existing output Entities.

Select all the attributes using SELECT {Question}.*, {QuestionLocale}.* to match the output
Entities.

Create two separate Aggregates, which are automatically optimized by the platform, and
perform the Join in memory with some extra logic.
20. Consider you have a Contact_List screen and a Contact_Popup_Edit popup
screen to create, edit, or delete contacts. Select the best option with the least possible
impact on the screen rendering.

On the Popup Screen, use the Popup_Editor_Notify action to send to the Contact_List
Screen the operation that was executed (created, updated or deleted). On the callback in the
Contact_List Screen, refresh the query in the preparation and then use the
NotifyGetMessage() to determine the operation and act accordingly, i.e. refresh the entire
table, refresh the current row or remove the row using the ListRemove action, respectively.

On the Popup Screen, use the Notify action to notify the parent (the Contact_List Screen)
about the operation that was executed (created, updated or deleted). Then, according to the
message sent, the Contact_Popup_Edit Screen updates the Contact_List Screen, i.e. it
refreshes the entire table if a contact was created, refreshes the current row of the
TableRecords if the record was updated or uses the ListRemove Action to remove the
current row of the TableRecords if the contact was deleted.

On the Popup Screen, use the Popup_Editor_Notify action to send the updated record to the
Contact_List Screen. Update the current row of the TableRecords with the record returned
by the NotifyGetMessage() action. If the Popup_Editor_Notify action returns an empty record
use ListRemove action to remove the current row of the TableRecords.

On the Popup Screen, use the Popup_Editor_Notify action to notify the Contact_List Screen.
On the callback in the Contact_List Screen, refresh the query on the Preparation and refresh
the TableRecords.

21. Consider the need to provide a native-like mobile interface over an existing
Expenses Web application. Select the correct option.

Create a Mobile app that reuses the screens from the Expenses application and apply to
these referenced screens the mobile theme of the new app.

Create a Mobile app and, using references to existing actions and entities of the Expenses
application, and then build the screens for the mobile interface.

In Service Studio, configure the existing Expenses application's Native Platforms tab with
information for native app generation and reuse the existing entities and actions.

Create a Mobile Web Flow in the Expenses application with the mobile screens, reusing
existing entities, actions and theme already defined in there.
22. Consider a fast-growing entity, where only a small portion of its records are
actively in use. For auditing and legal reasons, the application needs to keep all
records, regardless of how frequently they are accessed.
What is the best approach to avoid deterioration of performance when accessing the
entity's records?

Have a timer that periodically moves unused records to an archive entity. Create an
additional screen to access all data if needed, from both the original entity and the archive
entity

Have a database script to manually archive unused records whenever you need to recover
space or speed up accesses to the entity

Add a new IsArchived boolean attribute to the entity, create an index for it and add a filter on
the listing screen. Have a timer regularly setting this new attribute to True for any unused
records

Create indexes for the most common access criteria (e.g. creation date) to speed up the
most frequent operations

23. Regarding User Groups, select the correct option.

- Removing a Role from a Group revokes the Role from all members of the Group that don't
have a direct association to that Role.
- A Group can be associated to a Human Activity through the System API ActivitySetGroup.

- Removing a User from a Group revokes from the User all Roles in the Group that the User
has no direct association with.
- Groups can only be created and managed in Users application.

- Adding a User to a Group grants all Roles in the Group to the User.
- A specific Group can be associated to a Human Activity at design time.

- Adding a Role to a Group grants the Role to all members of the Group.
- Groups can be associated to Web Screens and Human Activities at design time.
24. Consider the two solutions (A and B) for the Action MoveHistory, with two Input
Parameters, that updates the OrderHistory Identifier from OldOrderId to NewOrderId.
Taking into account this scenario, select the correct answer.

Solution B is the best, because UpdateOrderHistory is always optimized to update only the
changed attributes.

Solution A should be avoided, because adding new attributes to OrderHistory will produce
runtime errors, not detectable by Service Studio.

Solution A is the best, because it performs a bulk update on a single attribute.

Solution A is the only one that works.

25. A Static Entity is an Entity ...

... that can only hold basic data type values, excluding references to other Entities.

... whose attribute data types are limited to basic data types or Static Entities' identifiers.

... used to define non-modifiable (constant) values with attributes limited to Id, Label, Order
and Is_Active.

... whose attributes must be always mandatory.


26. Isolating a highly reusable Aggregate in a Server Action that returns the output of
the Aggregate, it’s always a good recommendation.

Yes, because it promotes reusability and simplifies maintenance.

Yes, because it promotes abstraction.

No, because it prevents the platform's automatic Aggregate optimization.

No, because it hides business logic behind an extra level of abstraction.

27. In the design of a Process flow, what defines an Automatic Activity?

A Human Activity with no user assigned to it.

An Action flow that cannot have output parameters.

An asynchronous Action that doesn't require the process execution to wait for its termination.

None of other options.

28. A Process may be launched...

... only explicitly in an Action flow.

... automatically when a record of an Entity exposing process events is created.

... either automatically when an Entity record is created, or explicitly in an Action flow, as
long as the module (eSpace) is the User Provider.

... automatically on any Entity record creation or update.


29. We need to register questions for an exam. Each question can have an image, and
has to be translated to several predefined languages.
Pick the best (more performant) database model scenario to capture these
requirements.

Scenario 3, because translations are indexed by static entity Locale and applications benefit
from strong typing.

Scenario 2 and 3 are the same. There's no point in isolating binary content since the
platform optimizes the aggregates guaranteeing that the binary fields are not returned from
the database.

Scenario 1, because there is only one image and several translations. A simple Locale
attribute of Text type is enough and more flexible to distinguish translation locales.

Scenario 2, because binary content is isolated, translations are indexed by an enumerated


set of values and common info is stored at the common record.
30. When trying to speed up a slow screen, one should...

...avoid complex SQL queries in the Preparation that can be replaced by a For Each loop
with efficient aggregates.

...store information gathered in the Preparation in session variables.

...pre-process as much as possible during the Preparation to speed operations on screens


actions.

...avoid as much as possible any processing of query results in the Preparation, delaying it to
the write operations.

31. Caching the result of Preparation queries, as well as Screen and Block content,
will always speed up the web responses. Taking into account this statement, select
the correct option.

Don't agree. Caching should always be avoided because every time the Input Parameters of
the cached data change, the server will take longer to respond and the cache may need to
be invalidated.

Partially agree. Caching should be restricted to the most frequently used elements and
avoided whenever repeated access doesn't yield the same Output, or Input Parameters vary
frequently.

Partially agree. Caching is pointless when used on intranet applications, because local
access is fast enough to speed up web requests.

Totally agree. Caching elements ensures that the server uses fewer resources and clients
get faster responses.
32. Given the following Entity Diagram, which index for JobApplication would you
create to ensure that the same Candidate does not apply to the same JobPosition
twice?

Alternative #4

Alternative #3

Alternative #2

Alternative #1
33. Consider the following code snippet from a module (eSpace) that implements a
data bootstrap from an Excel file. This implementation successfully imports all the
information contained in the Excel file.

Which of the following options is correct?

Timers with Schedule set to 'When Published' are executed using the Scheduler Service.

Timers have a runtime property to know if they were already executed in a publish. It is
useful to implement bootstrap logic to run in the first and in the following publishes.

Timers with Schedule set to 'When Published' will only execute the first time the module is
published.

Timers with Schedule set to 'When Published' cannot be executed using the Run Now button
in Service Center.
34. Select the sentence that describes an appropriate reason to use Expand Inline in a
SQL Query parameter.

To set the parameter as optional, preventing any clause using it to be inserted in the
generated SQL.

To implement optional search filters, by injecting certain query conditions only when
required.

To avoid SQL injection that could otherwise be explored with a normal parameter.

To inject parts of the query, although developers won't be able to prevent SQL injection.

35. In the following picture, the solution on the left presents two front-end
applications (appA and appB) and a core component (coreC) that abstracts some
reusable service. appA provides a reusable business concept required by coreC, with
some of this concept's logic being implemented in appB, causing problems with the
solution's dependencies.

Knowing that these dependencies violate the rules for a good architecture, pick the
best alternative and justification to fix this architecture.

Alternative 2, because it's the only one that solves the circular dependencies

Alternative 1, because it is less granular

Alternative 2, because it clearly has one module for each code source (coreA for code that
came from appA and coreB for code that came from appB) and this is more important than
grouping by functionality.

Alternative 1, because correctly isolates the reusable service from appA and appB to the
new core component coreAB
36. Consider the following Web Screen, with an input parameter named CinemaId of
type Cinema Identifier. Which of the following options is true when accessing the
application in a browser with the following URL
http://<server_address>/OSMDb/CinemaDetail.aspx ?

At the beginning of the Preparation, the CinemaId input parameter will have the
NullIdentifier() value.

The end-user will be prompted to enter a value for the input.

It is not possible to access a Screen with mandatory Input Parameters, without specifying
their values.

The end-user will see an error message.


37. What is the security behavior expected with the following configuration?

Screen Candidates requires the user to log in to the app.


Screen CandidateDetail requires the user to log in to the app if the user is not yet
authenticated in Windows or his credentials fail.
Both screens are only accessible from the Internal Network.

Screen Candidates is accessible from the Internal Network without requiring any Windows
authentication.
Screen Candidates is accessible from outside the Internal Network if the user is
authenticated in Windows.
Screen CandidateDetail is only accessible from the Internal Network if the user is
authenticated in Windows.

Screen Candidates requires the user to log in to the app only if the user is not yet
authenticated in Windows or his credentials fail.
Screen CandidateDetail requires the user to log in to the app if the user is not yet
authenticated in Windows or his credentials fail.
Both screens are only accessible from the Internal Network.

None of these behaviors.


38. Consider that you have some extensive JavaScript code, that defines several
functions, used in one of the most frequently accessed Screens. Where should you
place that code?

In the Screen's JavaScript property, because it allows browser caching and the code is only
used in this Screen.

Place it in the module (eSpace) JavaScript property, to allow reuse and because it is the
only place that allows browser caching.

Expanded directly in that Screen using an unescaped expression, since this code is used
only in one place.

This code should be placed as the return of an Action (which should also be a function), to
allow isolation and future reuse by simply calling that function inside a screen unescaped
expression.

39. In a multi-developer environment, if one needs to test/debug his own logic


updates without affecting other developers working on the same module (eSpace), it
is best to...

...Run and Debug in the Personal Area to avoid having to merge updates on the Public Area
and interfering with other developers while debugging.

...agree time slots for each developer to publish and test. Besides that, use Service Center
Version Control and Service Studio Compare and Merge to keep collaborative work
synchronized.

...1-Click Publish to update (and merge) changes, and then debug in the Personal Area to
avoid interfering with debugging sessions of other developers.

...clone the module (eSpace), work on it and merge back once fully tested.
40. Based on the scenario below, select the correct option.

The local module (eSpace) was updated by admin after mbd published the "other" module
(eSpace), so a merge is really necessary in this case.

Double-clicking on DownloadResource Screen Action will show two Screen Action canvas,
side by side, with no differences.

The ResizePicture Action was deleted on the "other" module (eSpace).

Selecting the SetToDoCompletedDate Action on the "other" module (eSpace), will merge the
changes in the Action Flow with the logic in the local module (eSpace).

You might also like