Thanks for the info.
So if I understand it correctly, you (want to) do the following:
- open connection
- send user info to VPD function to create specific predicate
- execute query
-> append VPD predicate
- return results
Correct?
If you use our adapter paradigm, (recommended in this case), you can derive a class from DataAccessAdapter, the class which is used to connect to the db and execute queries, and override the method which opens the connect: OpenConnection. You should then in that override first call the base method (so the connection is open) and then execute the call to the VPD function to send the user info. This can for example be done by creating OracleCommand objects in that routine or by creating a new ActionQuery object and filling in the SQL query inside the command.
This makes sure that whenever a connection is opened to the DB, the user info is send over the connection before anything else is done. This means that the user info is tied to the open connection on the server, so any activity executed over the connection is tied to the user.
There are other ways to achieve what this VPD function accomplishes btw, but it's up to you if you want to use these, as they're client side oriented:
1) you can override methods in the derived class of DataAccessAdapter which are executed when a fetch is executed. these methods get the SQL to be executed and you can modify that SQL, e.g. append a predicate
2) you can also use our authorization feature so some users can and some users can't see data/alter data/save data/ modify data, this is all managed using simple authorizer classes. For an example, see the authorization example on our website.