Start and end database transaction event


For setting and cleaning the context in a database session I like to have a start and end database transaction event.

Outsystem uses a connection pool. So the same session can be used by anyone.

I don’t like to set the db context in every sever action where I do database actions. But only once when starting a database transaction.

So i like to have an event to start a serveraction where i can execute an advanced sql action.

Created on 9 Oct 2018
Comments (9)

I don't understand the need for this? A transaction is started when your page starts processing, and automatically commits when processing is 100% done. If you want to commit before then, there is the Commit Transaction action. Why do you need to do what you are asking for?


Hi Justin,

This could be the case in a Web application, but in a mobile application this is not possible and also ajax calls can have different transactions . 

It has also nothing to do with committing a transaction. 

In Oracle I like to know which Outsystems User, device or outsystems session is executing a procedure or is querying a table.

I have to provide this to the, by outsystems used, Oracle session. and I like to do this only once per database transaction (Oracle session use).

What is the actual goal here? Creating an audit trail? Trying to get usage statistics? Something else?


Hi Justin,

I wil use this  for multiple purposes, at this moment it is needed to fetch the actual outsystem users in the database triggers which are journaling the mutations on certain tables. And  later on I will use it in a kind of VPD (Virtual Private Database) solution.

Fred -

It sounds to me like what you really need is to write CRUD wrappers that do this? You are trying to work at a level which is HIGHLY not recommended, from what I can tell. Manually adding triggers to the data tables is not the way to go for this kind of task.


Also, I don't think mobile even has the concept of transactions, and definitely doesn't have the concept of triggers.

Hi Justin,

I have no choice, I have to deal with an existing system, what also is used by non outsystems applications. And, I have Written CRUD wrappers which are doing the session context setting as the first action, but then these wrappers are doing this always, not only at the beginning of a transaction. So I like to have a solution where I can code this in an event.

Well, I doubt this is ever going to be implemented Fred, so either way, you'll have to find a workaround.

Changed the category to Backend