4 Replies Latest reply on Nov 21, 2013 2:44 AM by raylite3

    How to execute a stored procedure when getting a connection from datasource

    raylite3 Apprentice



      I am using Oracle VPD (virtual private database) in my application to support multi-tenancy. To use Oracle VPD, I need to execute a stored procedure to set the context to the correct tenant every time I get a connection (and a corresponding stored proc to unset the context when I release the connection). I am using plain JDBC.


      Is there a nifty callback or extension I can use for my Oracle datasource to execute this stored proc? Perhaps a <connection-listener> will work?


      Any ideas appreciated.