-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection Pooling in Ora driver ? #50
Comments
Hi JM, Will consider it. I did look into OCI connection pooling when initially designing the driver but considered too much effort for a first version for a feature which might not be used and already has support in database/sql. It's not clear to me how many people use database/sql only or use the direct driver only. What sort of behavior are you seeing with Oracle connections and database/sql? Aside from database/sql, my understanding is that Oracle will itself close connections within a connection pool after a period of inactivity. Thank you, Rana |
Session pooling is nice, but I couldn't make it work with our external authentication (Oracle Wallet) in cx_Oracle. Also, expermients shows that to use n processors, you have to use n separate Srvs. But against frequent session reopening, some pooling should be used. A general IdlePool is at github.com/tgulacsi/go/pool, and a WIP connection (Srv/Ses) pool is in the "pool" branch here. |
It's cool. Thank's. |
I've split the pooling into Env.NewSrvPool + Srv.NewSesPool, as I couldn't make the srv+ses pooling leak free: you can open any number of sessions on a connection, but can only close/release that connection back to its pool when all sessions are closed on it. And closed, not just released to the pool... |
Please considered in your roadmap the support of Connection Pooling in Ora driver.
The "database/sql" works but in real cases for applications 7x24, I have random behavior for keep connections alive.
I refer to Oracle Connection Pooling done by OCI.
Thank's,
JM
(from Oracle Call Interface Programmer's Guide)
Connection pools
Connection pooling is the use of a group (the pool) of reusable physical connections by several sessions, in order to balance loads. The management of the pool is done by OCI, not the application. Applications that can use connection pooling include middle-tier applications for Web application servers and e-mail servers.
Session Pools
Session pooling means that the application will create and maintain a group of stateless sessions to the database. These sessions will be handed over to thin clients as requested. If no sessions are available, a new one may be created. When the client is done with the session, the client will release it to the pool. Thus, the number of sessions in the pool can increase dynamically.
The text was updated successfully, but these errors were encountered: