Alter session and connection pooling

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Olof
Posts: 8
Joined: Thu 09 Jun 2011 11:18

Alter session and connection pooling

Post by Olof » Wed 28 May 2014 09:36

Hi !

I'm not very clear with connection pooling.

Say I have a pool of 2 connections. What happend, if in my code, I do an "alter session...". The connection actually in use will be altered, I guess. And the other ? And after that, this connection return in the pool. Is it always altered ? And after that, another user take this connection from the pool. Is it always altered ?

Thank you !

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

Re: Alter session and connection pooling

Post by Pinturiccio » Thu 29 May 2014 15:43

When a connection uses connection pooling, after closing it, the actual connection is still open and placed to the pool. When you open a connection with the same connection string, it is taken from the pool.

If you have performed the ALTER SESSION before closing the connection, the session will still be altered when the connection is taken from the pool.

If you don't want a user to have the connection changes, that were made by other user, applied, you need to either alter it again to undo changes before closing it or disable connection pooling (specify 'pooling=false').

Olof
Posts: 8
Joined: Thu 09 Jun 2011 11:18

Re: Alter session and connection pooling

Post by Olof » Mon 02 Jun 2014 05:49

Thank you !

Post Reply