Check if new connection is from pool or new

Check if new connection is from pool or new

Postby Tobsel » Thu 19 Nov 2015 13:38

Hello,

I need to know if a new created OracleConnection Object is when opend from pool or a newly established Db-Connection. After a connection is established we need to start some database commands. I tried the Initialization Command property but it seems that this is always executed when the connection object state is opened. I need a command that is only executed once at the first time a db connection is established.

Thank you very much,
Tobsel
Tobsel
 
Posts: 9
Joined: Fri 28 May 2010 12:31

Re: Check if new connection is from pool or new

Postby Pinturiccio » Mon 23 Nov 2015 14:02

Initialization Command is executed each time the connection is opened regardless of whether a new connection is actually created or an existing connection is taken from the pool. We will investigate the possibility of implementing a initialization command that is executed only if a new session is created when the connection is opened, but we can't tell any timeframe at the moment.
Pinturiccio
Devart Team
 
Posts: 1866
Joined: Wed 02 Nov 2011 09:44

Re: Check if new connection is from pool or new

Postby Shalex » Tue 26 Apr 2016 17:09

The Run Once Command connection string parameter, which specifies a command or several commands to execute when the connection is opened the first time and not executed when the connection is taken from the pool, is added in the newest (9.0) version of dotConnect for Oracle: http://forums.devart.com/viewtopic.php?f=1&t=33571.
Shalex
Devart Team
 
Posts: 7391
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle