Forum Stats

  • 3,853,894 Users
  • 2,264,290 Discussions
  • 7,905,498 Comments

Discussions

Issue in OracleConnection.ClearPool() while upgrading from Oracle12c to Oracle19c

73f0f6a7-281c-443e-8ee2-877e99fa829d
edited Sep 11, 2020 5:37AM in Database Upgrade

We are in a process of upgrading our Oracle12c to Oracle 19c. while doing so we are facing issue when we clear the connection pool.

Below are the client dll version (Oracle.DataAccess.dll)

  • 12c - 4.122.1.0
  • 19c - 4.122.19.1

refer below code snippet, same code is clearing the connection pool with 12c oracle client dll but it's not working with 19c oracle client. tried debugging the dlls using reflactor and found that there is a slight change in implementation of ClearPool method between those 2 versions. Can anyone help - what would be equivalent code in oracle 19c? Is there any additional parameter needs to be set for 19c? in below code when ClearPool method gets called a connection created by that user in v$session is gone in 12c but the same does not work in 19c

select * from v$session where username = 'XYZ' -- user for which the connection was created

Code Snippet:

<span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">public</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> bool ClearConnectionPool</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">ref string connectioString</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">)</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  bool flag </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> false</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">;</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  OracleConnection objConn</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">;</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  try<br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  objConn </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> new OracleConnection</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">connectioString</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  OracleConnection</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">ClearPool</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">objConn</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/><br/>  flag </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> true</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">;</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  catch </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">InvalidOperationException iex</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">)</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  ExceptionHelper</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">HandleException</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">iex</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  flag </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> false</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">;</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  catch </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">Exception ex</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">)</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">{</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  ExceptionHelper</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">.</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">HandleException</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">(</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">ex</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">);</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>  flag </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">=</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> false</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">;</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/><br/>   </span><span class="kwd" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--blue-800);">return</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"> flag</span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">;</span><span class="pln" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);"><br/>   </span><span class="pun" style="font-style: inherit; font-weight: inherit; font-family: inherit; color: var(--black-750);">}</span>