Page 1 of 1

Check if new connection is from pool or new

Posted: Thu 19 Nov 2015 13:38
by Tobsel
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

Re: Check if new connection is from pool or new

Posted: Mon 23 Nov 2015 14:02
by Pinturiccio
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.

Re: Check if new connection is from pool or new

Posted: Tue 26 Apr 2016 17:09
by Shalex
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.