Check if new connection is from pool or new

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Tobsel
Posts: 15
Joined: Fri 28 May 2010 12:31

Check if new connection is from pool or new

Post by 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

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Check if new connection is from pool or new

Post by 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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Check if new connection is from pool or new

Post by 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.

Post Reply