0

We are using spring for transaction management .

When ever a new java.sql.Connection is created from data source , we want to call a procedure on this connection object.

The procedure is used to set certain session variables in the Oracle DB.

So far we could not find any call backs or interceptors from the spring transaction aspect where we can accomplish this.

If anybody is aware of any such provision where we can get handle to the connection object using the current transaction , kindly revert back

lives
  • 1,243
  • 5
  • 25
  • 61
  • This has nothing to do with transaction. I am guessing that you'd want your connection to be initialised if you use it outside of a transaction, right? You can wrap the `DataSource` and run whatever code when a connection is retrieved from the pool. – Stephane Nicoll Aug 27 '14 at 12:15
  • I need to invoke a procedure on the connection object whenever a new connection is obtained from datasource , irrespective of transaction is on/off. Looks like some sort of data source wrapper would help where I can execute the stored procedure before the connection is returned from the data source. – lives Aug 29 '14 at 15:50

0 Answers0