Page 1 of 1

Alter session and connection pooling

Posted: Wed 28 May 2014 09:36
by Olof
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 !

Re: Alter session and connection pooling

Posted: Thu 29 May 2014 15:43
by Pinturiccio
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').

Re: Alter session and connection pooling

Posted: Mon 02 Jun 2014 05:49
by Olof
Thank you !