@@ -105,7 +105,7 @@ namespace
105
105
using namespace occ ;
106
106
107
107
// -----------------------------------------------------------------------------
108
- #define DO_OCI_HANDLE_FREE (res, t, l, errhp2 ) real_oci_handle_free(reinterpret_cast <dvoid*&>(res), t, #res, l, errhp2 )
108
+ #define DO_OCI_HANDLE_FREE (res, t, l, errhp ) real_oci_handle_free(reinterpret_cast <dvoid*&>(res), t, #res, l, errhp )
109
109
110
110
#define NUM_INDICATOR_BUF 64
111
111
#define NUM_STR_SIZE_BUF 64
@@ -209,7 +209,7 @@ OCCChild::OCCChild(const InitParams& _params) : Worker(_params),
209
209
stmt_cache(NULL ),
210
210
cur_stmt(NULL ),
211
211
max_cache_size(0 ),
212
- max_oci_stmt_cache_size(0 )
212
+ max_oci_stmt_cache_size(0 ),
213
213
max_statement_age(0 ),
214
214
cache_size(0 ),
215
215
cache_size_peak(0 ),
@@ -363,7 +363,7 @@ OCCChild::OCCChild(const InitParams& _params) : Worker(_params),
363
363
364
364
// MAX OCI statement cache size parameter and it should be > 0
365
365
if (config->get_value (" max_oci_stmt_cache_size" , cval))
366
- max_oci_stmt_cache_size = StringUtil::to_int (c_val );
366
+ max_oci_stmt_cache_size = StringUtil::to_int (cval );
367
367
368
368
if (enable_oci_stmt_cache && max_oci_stmt_cache_size < 1 )
369
369
{
@@ -4779,41 +4779,25 @@ int OCCChild::clear_indicators()
4779
4779
return 0 ;
4780
4780
}
4781
4781
4782
-
4783
- bool real_oci_handle_free (dvoid *&hndlp, ub4 type, const char *res, LogLevelEnum level, OCIError *errhp = NULL )
4782
+ bool OCCChild::real_oci_handle_free (dvoid *&hndlp, ub4 type, const char *res, LogLevelEnum level, OCIError *errhp)
4784
4783
{
4785
4784
int rc;
4786
-
4787
4785
if (hndlp == NULL ) return true ;
4788
-
4789
- // Special handling for statement handles when caching is enabled
4790
4786
if (type == OCI_HTYPE_STMT && errhp != NULL ) {
4791
- // Release to cache instead of freeing (assuming caching is enabled)
4792
4787
rc = OCIStmtRelease ((OCIStmt*)hndlp, errhp, NULL , 0 , OCI_DEFAULT);
4793
- if (rc != OCI_SUCCESS) {
4794
- std::ostringstream os;
4795
- os << " failed to OCIStmtRelease(" << (res ? res : " (null)" ) << " )" ;
4796
- log_oracle_error (rc, os.str ().c_str (), level);
4797
- return false ;
4798
- }
4799
- // Note: Do not set hndlp = NULL here if you want to allow reuse in cache
4800
- // The cache manages the handle; it will be freed with the session
4801
- return true ;
4788
+ } else {
4789
+ rc = OCIHandleFree (hndlp, type);
4790
+ hndlp = NULL ;
4802
4791
}
4803
-
4804
- // For all other handle types, use OCIHandleFree
4805
- rc = OCIHandleFree (hndlp, type);
4806
- hndlp = NULL ;
4807
4792
if (rc != OCI_SUCCESS) {
4808
4793
std::ostringstream os;
4809
- os << " failed to OCIHandleFree(" << (res ? res : " (null)" ) << " )" ;
4794
+ os << " failed to " << (type == OCI_HTYPE_STMT ? " OCIStmtRelease " : " OCIHandleFree" ) << " (" << (res ? res : " (null)" ) << " )" ;
4810
4795
log_oracle_error (rc, os.str ().c_str (), level);
4811
4796
return false ;
4812
4797
}
4813
4798
return true ;
4814
4799
}
4815
4800
4816
-
4817
4801
int OCCChild::get_column_size (int *size, ub2 *type, ub4 pos, bool use_datetime)
4818
4802
{
4819
4803
int rc = 0 ;
0 commit comments