On Wed, Oct 13, 2004 at 06:25:25PM +0200, Roberto Re wrote:
> First of all thanks for your attention, Alan
> 
> My problem however seems to be more like this:
> http://lists.cistron.nl/pipermail/freeradius-devel/2002-December/004052.html
> 
> I had already checked the working code, which includes that patch and it
> is exactly the following one:
> 
> http://www.freeradius.org/cvs-log/radiusd/src/modules/rlm_sql/drivers/rlm_sql_oracle/sql_oracle.c
>

The code in this url does not include the patch Alan is reffering
to. Of course the patch in
http://bugs.freeradius.org/show_bug.cgi?id=128 addresses the
freeradius crash in case of Oracle errors in sql queries. This happens
with the Oracle 8i client libraries. I was told that Oracle 9 client
libs do not cause the freeradius crash (not tested my self). Anyway
the proposed patch is said to better handle the Oracle connections.
I tested the patch myself and it works OK. Crashes no longer occur and
freeradius handles Oracle connections better.

However the patch is not included in freeradius 1.0.1. Any plans of
including it in a later version?

I resubmit the patch as a text file (output of 
diff sql_oracle.c.before_patch sql_oracle.c > freeradius_oracle_patch)
because from the web page I had
problems applying it and I was forced to apply it partly by hand
editing of the code...  

Kostas
 
> Function: sql_free_result , does this function realease memory but not 
> any cursors on the oracle side?
> 
> Thanks
> Roberto
> 
> 
> 
> 
> 
> Alan DeKok wrote:
> 
> >Roberto Re <[EMAIL PROTECTED]> wrote:
> >
> >>I've installed a FreeRADIUS version 1.0.0 on a Linux Red Hat Enterprise 
> >>with Oracle Client 9.1, it never close any cursors it opened, leading to 
> >>all sorts of interesting problems when the max-open-cursor limits
> >>were hit.
> >>
> >>How can I fix this problem ?
> >
> >
> >     http://bugs.freeradius.org/show_bug.cgi?id=128
> >
> >  The patch there may help.  If it does, please say so on the list.
> >
> >  Alan DeKok.
> >
> >- 
> >List info/subscribe/unsubscribe? See 
> >http://www.freeradius.org/list/users.html
> >
> 
> 
> 
> - 
> List info/subscribe/unsubscribe? See 
> http://www.freeradius.org/list/users.html
> 

-- 
  Kostas Zorbadelos
  Systems Developer, Otenet SA 
  mailto: [EMAIL PROTECTED]
  
  Out there in the darkness, out there in the night
  out there in the starlight, one soul burns brighter
  than a thousand suns.

75a76,94
> /*************************************************************************
>  *
>  *    Function: sql_check_error
>  *
>  *    Purpose: check the error to see if the server is down
>  *
>  *************************************************************************/
> static int sql_check_error(SQLSOCK *sqlsocket, SQL_CONFIG *config) {
> 
>       if (strstr(sql_error(sqlsocket, config), "ORA-03113") ||
>                       strstr(sql_error(sqlsocket, config), "ORA-03114")) {
>               radlog(L_ERR,"rlm_sql_oracle: OCI_SERVER_NOT_CONNECTED");
>               return SQL_DOWN;
>       }
>       else {
>               radlog(L_ERR,"rlm_sql_oracle: OCI_SERVER_NORMAL");
>               return -1;
>       }
> }
247c266
<                               (ub4) OCI_DEFAULT);
---
>                               (ub4) OCI_COMMIT_ON_SUCCESS);
249,252c268,269
<       if ((x != OCI_NO_DATA) && (x != OCI_SUCCESS)) {
<               radlog(L_ERR,"rlm_sql_oracle: execute query failed in sql_query: %s",
<                               sql_error(sqlsocket, config));
<               return SQL_DOWN;
---
>       if (x == OCI_SUCCESS) {
>               return 0;
255,257c272,273
<       x = OCITransCommit(oracle_sock->conn, oracle_sock->errHandle, (ub4) 0);
<       if (x != OCI_SUCCESS) {
<               radlog(L_ERR,"rlm_sql_oracle: commit failed in sql_query: %s",
---
>       if (x == OCI_ERROR) {
>               radlog(L_ERR,"rlm_sql_oracle: execute query failed in sql_query: %s",
259c275,278
<               return SQL_DOWN;
---
>               return sql_check_error(sqlsocket, config);
>       }
>       else {
>               return -1;
261,262d279
< 
<       return 0;
314,316c331,335
<       else if (x != OCI_SUCCESS) {
<               radlog(L_ERR,"rlm_sql_oracle: query failed in sql_select_query: 
%s",sql_error(sqlsocket, config));
<               return SQL_DOWN;
---
> 
>       if (x != OCI_SUCCESS) {
>               radlog(L_ERR,"rlm_sql_oracle: query failed in sql_select_query: %s",
>                               sql_error(sqlsocket, config));
>               return sql_check_error(sqlsocket, config);
495,496c514,517
<       if (x == OCI_NO_DATA) {
<               return -1;
---
>       
>       if (x == OCI_SUCCESS) {
>               sqlsocket->row = oracle_sock->results;
>               return 0;
498,499c519,520
<       else if (x != OCI_SUCCESS) {
<               /* XXX Check if x suggests we should return SQL_DOWN */
---
>       
>       if (x == OCI_ERROR) {
502c523
<               return SQL_DOWN;
---
>               return sql_check_error(sqlsocket, config);
503a525,527
>       else {
>               return -1;
>         }
505,506d528
<       sqlsocket->row = oracle_sock->results;
<       return 0;

Reply via email to