Re: [sqlalchemy] connection pooling

2023-06-08 Thread Mike Bayer
On Thu, Jun 8, 2023, at 12:47 PM, Suraj Shaw wrote: > Hi Mike, > > One more update. > I am using DRCP functionality of oracle so i have to add :pooled at the end > of connect string. > If you run without using :pooled it is running correctly with output as > (datetime.datetime(2023, 6, 8, 22,

Re: [sqlalchemy] connection pooling

2023-06-08 Thread Mike Bayer
On Thu, Jun 8, 2023, at 12:38 PM, Suraj Shaw wrote: > Hi Mike, > > Is it like first conn.close() is closing the pool itself instead of releasing > connection back to pool. SQLAlchemy calls the .close() method on the connection itself. Per oracledb docs at

Re: [sqlalchemy] connection pooling

2023-06-08 Thread Suraj Shaw
Hi Mike, One more update. I am using DRCP functionality of oracle so i have to add :pooled at the end of connect string. If you run without using :pooled it is running correctly with output as (datetime.datetime(2023, 6, 8, 22, 13, 56, 762291),) (datetime.datetime(2023, 6, 8, 22, 13, 57,

Re: [sqlalchemy] connection pooling

2023-06-08 Thread Suraj Shaw
Hi Mike, Is it like first conn.close() is closing the pool itself instead of releasing connection back to pool. Thanks Suraj On Thu, 8 Jun 2023 at 18:34, Mike Bayer wrote: > unknown. I've run your program exactly as written with SQLAlchemy 2.0.15 > and it succeeds on both queries. I would

Re: [sqlalchemy] connection pooling

2023-06-08 Thread Mike Bayer
unknown. I've run your program exactly as written with SQLAlchemy 2.0.15 and it succeeds on both queries. I would advise reaching out to https://github.com/oracle/python-oracledb/discussions for debugging help. feel free to show them our recipe from

Re: [sqlalchemy] Connection pooling uses connections rather than sessions

2020-12-10 Thread Anupama Goparaju
Thanks a lot for the inputs! On Wednesday, December 9, 2020 at 9:08:51 PM UTC-7 Mike Bayer wrote: > Oracle describes SessionPool at: > > > https://cx-oracle.readthedocs.io/en/latest/user_guide/connection_handling.html#connpool > > This pool describes the connection lifecycle as first calling >

Re: [sqlalchemy] Connection pooling uses connections rather than sessions

2020-12-09 Thread Mike Bayer
Oracle describes SessionPool at: https://cx-oracle.readthedocs.io/en/latest/user_guide/connection_handling.html#connpool This pool describes the connection lifecycle as first calling pool.acquire(), and then pool.release(connection), however the good news is that if connection.close() is

Re: [sqlalchemy] Connection pooling uses connections rather than sessions

2020-12-09 Thread Anupama Goparaju
I have tried below approach in SQLAlchemy 1.3.16. Use a creator function - if you need to use special form when calling cx_oracle.connect(), a creator function will allow you to plug into the Engine how cx_oracle connections are established. The creator function, that i associated would

Re: [sqlalchemy] Connection pooling uses connections rather than sessions

2020-12-09 Thread Anupama Goparaju
Hi. I would like to know how to use a cx-oracle SessionPool with SQLAlchemy. We are leveraging the Session object of SQLAlchemy but we would like to use the driver level pooling instead of SQLAlchemy pool. Please advise. Thanks, Anupama On Monday, October 3, 2011 at 12:23:58 PM UTC-6 Mike

Re: [sqlalchemy] Connection pooling strategy for a small/fixed number of db users

2015-03-03 Thread Russ
well the engine is essentially a holder for a connection pool. If you use a pool like NullPool, it makes a new connection on every use, but in that case there is still not an official way to send in different connection parameters. There’s no advantage to trying to make Engine work in

Re: [sqlalchemy] Connection pooling uses connections rather than sessions

2011-10-03 Thread Michael Bayer
This is a problem that would need to be solved mostly on the cx_oracle side, then using standard SQLAlchemy APIs to implement. Some googling didn't turn up a definitive answer if a single OCI connection can persist, while its underlying session is killed. I found

Re: [sqlalchemy] Connection pooling uses connections rather than sessions

2011-10-03 Thread Michael Bayer
On Oct 3, 2011, at 2:20 PM, Michael Bayer wrote: 3. Use pool events to emit commands when connections are checked out or checked in. If you need to emit some SQL or cx_oracle commands on the DBAPI connection upon checkout or checkin, the Engine provides pool events which accomplish

Re: [sqlalchemy] connection pooling question, is it possible

2010-03-11 Thread Michael Bayer
Krishnakant Mane wrote: hello all, I am working on a free software for accounting and rural banking in India. We use Pylons for web application. Now, my question is in reference to the recent threads on this mailing list regarding sqlalchemy connections. I heard that after a certain amount

[sqlalchemy] Re: sqlalchemy connection pooling and mysql last_insert_id()

2008-07-11 Thread Henk
As far as I know SqlAlchemy does not use LAST_INSERT_ID() (at least not for single row inserts), At the mysql protocol level, the id created for the auto inc column will be returned for each insert statement (as the result code for that command). The python MySQLdb dbapi driver will make this