@@ -29,11 +29,13 @@ static PyObject *cxoSessionPool_getMaxLifetimeSession(cxoSessionPool*, void*);
2929static PyObject * cxoSessionPool_getOpenCount (cxoSessionPool * , void * );
3030static PyObject * cxoSessionPool_getStmtCacheSize (cxoSessionPool * , void * );
3131static PyObject * cxoSessionPool_getTimeout (cxoSessionPool * , void * );
32+ static PyObject * cxoSessionPool_getWaitTimeout (cxoSessionPool * , void * );
3233static int cxoSessionPool_setGetMode (cxoSessionPool * , PyObject * , void * );
3334static int cxoSessionPool_setMaxLifetimeSession (cxoSessionPool * , PyObject * ,
3435 void * );
3536static int cxoSessionPool_setStmtCacheSize (cxoSessionPool * , PyObject * , void * );
3637static int cxoSessionPool_setTimeout (cxoSessionPool * , PyObject * , void * );
38+ static int cxoSessionPool_setWaitTimeout (cxoSessionPool * , PyObject * , void * );
3739
3840
3941//-----------------------------------------------------------------------------
@@ -80,6 +82,8 @@ static PyGetSetDef cxoSessionPoolCalcMembers[] = {
8082 (setter ) cxoSessionPool_setMaxLifetimeSession , 0 , 0 },
8183 { "stmtcachesize" , (getter ) cxoSessionPool_getStmtCacheSize ,
8284 (setter ) cxoSessionPool_setStmtCacheSize , 0 , 0 },
85+ { "wait_timeout" , (getter ) cxoSessionPool_getWaitTimeout ,
86+ (setter ) cxoSessionPool_setWaitTimeout , 0 , 0 },
8387 { NULL }
8488};
8589
@@ -166,7 +170,7 @@ static int cxoSessionPool_init(cxoSessionPool *pool, PyObject *args,
166170 static char * keywordList [] = { "user" , "password" , "dsn" , "min" , "max" ,
167171 "increment" , "connectiontype" , "threaded" , "getmode" , "events" ,
168172 "homogeneous" , "externalauth" , "encoding" , "nencoding" , "edition" ,
169- NULL };
173+ "timeout" , "waitTimeout" , "maxLifetimeSession" , NULL };
170174
171175 // parse arguments and keywords
172176 usernameObj = passwordObj = dsnObj = editionObj = Py_None ;
@@ -185,12 +189,13 @@ static int cxoSessionPool_init(cxoSessionPool *pool, PyObject *args,
185189 (uint32_t ) strlen (dpiCommonParams .driverName );
186190 if (dpiContext_initPoolCreateParams (cxoDpiContext , & dpiCreateParams ) < 0 )
187191 return cxoError_raiseAndReturnInt ();
188- if (!PyArg_ParseTupleAndKeywords (args , keywordArgs , "|OOOiiiOObOOOssO " ,
192+ if (!PyArg_ParseTupleAndKeywords (args , keywordArgs , "|OOOiiiOObOOOssOiii " ,
189193 keywordList , & usernameObj , & passwordObj , & dsnObj , & minSessions ,
190194 & maxSessions , & sessionIncrement , & connectionType , & threadedObj ,
191195 & dpiCreateParams .getMode , & eventsObj , & homogeneousObj ,
192196 & externalAuthObj , & dpiCommonParams .encoding ,
193- & dpiCommonParams .nencoding , & editionObj ))
197+ & dpiCommonParams .nencoding , & editionObj , & dpiCreateParams .timeout ,
198+ & dpiCreateParams .waitTimeout , & dpiCreateParams .maxLifetimeSession ))
194199 return -1 ;
195200 if (!PyType_Check (connectionType )) {
196201 cxoError_raiseFromString (cxoProgrammingErrorException ,
@@ -529,6 +534,17 @@ static PyObject *cxoSessionPool_getTimeout(cxoSessionPool *pool, void *unused)
529534}
530535
531536
537+ //-----------------------------------------------------------------------------
538+ // cxoSessionPool_getWaitTimeout()
539+ // Return the wait timeout for connections in the session pool.
540+ //-----------------------------------------------------------------------------
541+ static PyObject * cxoSessionPool_getWaitTimeout (cxoSessionPool * pool ,
542+ void * unused )
543+ {
544+ return cxoSessionPool_getAttribute (pool , dpiPool_getWaitTimeout );
545+ }
546+
547+
532548//-----------------------------------------------------------------------------
533549// cxoSessionPool_setGetMode()
534550// Set the "get" mode for connections in the session pool.
@@ -582,3 +598,14 @@ static int cxoSessionPool_setTimeout(cxoSessionPool *pool, PyObject *value,
582598 return cxoSessionPool_setAttribute (pool , value , dpiPool_setTimeout );
583599}
584600
601+
602+ //-----------------------------------------------------------------------------
603+ // cxoSessionPool_setWaitTimeout()
604+ // Set the wait timeout for connections in the session pool.
605+ //-----------------------------------------------------------------------------
606+ static int cxoSessionPool_setWaitTimeout (cxoSessionPool * pool , PyObject * value ,
607+ void * unused )
608+ {
609+ return cxoSessionPool_setAttribute (pool , value , dpiPool_setWaitTimeout );
610+ }
611+
0 commit comments