Project

General

Profile

« Previous | Next » 

Revision 766

Added by bojilova over 23 years ago

the ODBC multi-threading problem:
in DBQuery we open ResultSet in the db connection and we are trying to
open another Resultset by AccessControlList which does not work
thus open separate connection for use by AccessControlList.

View differences:

src/edu/ucsb/nceas/metacat/DBQuery.java
210 210
      String fielddata = null;
211 211
      String relation = null;
212 212
      Connection dbconn = null;
213
      Connection dbconn2 = null;
213 214
      int rev = 0;
214 215
      StringBuffer document = null; 
215 216
      
......
219 220
        } else {
220 221
          dbconn = conn;
221 222
        }
223
        // problem with ODBC driver multi-threading
224
        dbconn2 = util.openDBConnection(); // for use by AccessControlList
225
        
222 226
        // Get the XML query and covert it into a SQL statment
223 227
        QuerySpecification qspec = new QuerySpecification(xmlquery, 
224 228
                                   parserName, 
......
232 236
        while (tableHasRows) 
233 237
        {
234 238
          docid = rs.getString(1);
235
          if ( !hasPermission(dbconn, user, group, docid) ) {
239
          if ( !hasPermission(dbconn2, user, group, docid) ) {
236 240
            // Advance to the next record in the cursor
237 241
            tableHasRows = rs.next();
238 242
            continue;
......
376 380
          while(tableHasRows) 
377 381
          {
378 382
            docid = rs.getString(1);
379
            if ( !hasPermission(dbconn, user, group, docid) ) {
383
            if ( !hasPermission(dbconn2, user, group, docid) ) {
380 384
              // Advance to the next record in the cursor
381 385
              tableHasRows = rs.next();
382 386
              continue;
......
478 482
        try
479 483
        {
480 484
          dbconn.close();
485
          dbconn2.close();
481 486
        }
482 487
        catch(SQLException sqle)
483 488
        {

Also available in: Unified diff