Hi Ties,
a nice challenge. you can indeed call a stored procedure to set the context of the user in the oracle database. You can do it in multiple ways. one way is by using the Oracle Connector (https://www.outsystems.com/forge/component-overview/6636/oracle-connector-p11). another way is by calling a function within an sql select statement like 'select setContext(user=> 1231) from my_dummy_view' (where you have to import the view my_Dummy_view in integration studio), and catch the result (e.g. true / false).
OutSystems uses the same database connection/transaction per client request (where your first server action starts). The transaction is committed at the end of the client flow. There are some special cases:
- a service action creates its own new transaction
- a webservice action creates its own new transaction
- bpt creates its own new transaction.
- timers creates their own new transactions as well.
You have to set the context for each request. In traditional you might use the on-begin-web-request action.
Good luck, Hans