Changeset 4119
- Timestamp:
- Feb 1, 2008, 4:31:53 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/AbstractSqlQuery.java
r3679 r4119 29 29 import net.sf.basedb.core.query.QueryType; 30 30 import net.sf.basedb.core.query.Select; 31 import net.sf.basedb.core.signal.SignalException; 31 32 32 33 import java.util.List; … … 111 112 Connection c = HibernateUtil.getConnection(dc.getHibernateSession()); 112 113 if (debugSqlEnabled) logSql.debug("Executing count query: " + countSql); 113 PreparedStatement ps = c.prepareStatement(countSql);114 final PreparedStatement ps = c.prepareStatement(countSql); 114 115 setParameters(ps, countParameterOrder); 115 ResultSet result = ps.executeQuery(); 116 117 ResultSet result = QueryExecutor.executeQuery(ps); 118 116 119 result.next(); 117 120 totalCount = result.getInt(1); … … 119 122 ps.close(); 120 123 } 124 catch (InterruptedException ex) 125 { 126 throw new SignalException("Aborted by user", ex); 127 } 121 128 catch (SQLException ex) 122 129 { … … 184 191 PreparedStatement ps = c.prepareStatement(sql); 185 192 setParameters(ps, parameterOrder); 186 result = ps.executeQuery();193 result = QueryExecutor.executeQuery(ps); 187 194 if ((getFirstResult() > 0) && !HibernateUtil.getDialect().supportsLimitOffset()) 188 195 { 189 196 result.absolute(getFirstResult()); 190 197 } 198 } 199 catch (InterruptedException ex) 200 { 201 throw new SignalException("Aborted by user.", ex); 191 202 } 192 203 catch (SQLException ex) … … 351 362 } 352 363 } 364 353 365 } -
trunk/src/core/net/sf/basedb/core/Application.java
r4117 r4119 425 425 426 426 // Initialise other utility classes 427 QueryExecutor.init(); 427 428 HibernateUtil.init1(); 428 429 ExtendedProperties.init(); … … 588 589 RawDataUtil.unload(); 589 590 RawDataTypes.unload(); 591 QueryExecutor.unload(); 590 592 ExtendedProperties.unload(); 591 593 Config.unload(); -
trunk/src/core/net/sf/basedb/core/FeatureBatcher.java
r4097 r4119 31 31 import net.sf.basedb.core.data.ReporterData; 32 32 import net.sf.basedb.core.data.WellData; 33 import net.sf.basedb.core.signal.SignalException; 33 34 34 35 import java.sql.PreparedStatement; … … 328 329 PreparedStatement ps = HibernateUtil.getConnection(getDbControl().getHibernateSession()).prepareStatement(sql); 329 330 ps.setInt(1, arrayDesign.getId()); 330 ps.executeUpdate();331 QueryExecutor.executeUpdate(ps); 331 332 arrayDesignData.setHasFeatures(false); 333 } 334 catch (InterruptedException ex) 335 { 336 throw new SignalException("Aborted by user.", ex); 332 337 } 333 338 catch (SQLException ex) -
trunk/src/core/net/sf/basedb/core/FilterBatcher.java
r3775 r4119 28 28 import net.sf.basedb.core.query.Expressions; 29 29 import net.sf.basedb.core.query.Selects; 30 import net.sf.basedb.core.signal.SignalException; 30 31 31 32 import java.util.List; … … 324 325 PreparedStatement ps = HibernateUtil.getConnection(getDbControl().getHibernateSession()).prepareStatement(insertSql); 325 326 query.setParameters(ps, parameterOrder); 326 rowsInserted = ps.executeUpdate();327 rowsInserted = QueryExecutor.executeUpdate(ps); 327 328 ps.close(); 328 329 bytes += rowsInserted * bytesPerRow; 329 330 totalInsertCount += rowsInserted; 331 } 332 catch (InterruptedException ex) 333 { 334 throw new SignalException("Aborted by user.", ex); 330 335 } 331 336 catch (SQLException ex) -
trunk/src/core/net/sf/basedb/core/MappingBatcher.java
r3775 r4119 29 29 import net.sf.basedb.core.query.Expressions; 30 30 import net.sf.basedb.core.query.Selects; 31 import net.sf.basedb.core.signal.SignalException; 31 32 32 33 import java.util.List; … … 256 257 PreparedStatement ps = HibernateUtil.getConnection(getDbControl().getHibernateSession()).prepareStatement(insertSql); 257 258 query.setParameters(ps, parameterOrder); 258 rowsInserted = ps.executeUpdate();259 rowsInserted = QueryExecutor.executeUpdate(ps); 259 260 ps.close(); 260 261 bytes += rowsInserted * bytesPerRow; 261 262 totalInsertCount += rowsInserted; 263 } 264 catch (InterruptedException ex) 265 { 266 throw new SignalException("Aborted by user.", ex); 262 267 } 263 268 catch (SQLException ex) -
trunk/src/core/net/sf/basedb/core/PositionBatcher.java
r3775 r4119 29 29 import net.sf.basedb.core.query.Expressions; 30 30 import net.sf.basedb.core.query.Selects; 31 import net.sf.basedb.core.signal.SignalException; 31 32 32 33 import java.util.List; … … 252 253 PreparedStatement ps = HibernateUtil.getConnection(getDbControl().getHibernateSession()).prepareStatement(insertSql); 253 254 query.setParameters(ps, parameterOrder); 254 rowsInserted = ps.executeUpdate();255 rowsInserted = QueryExecutor.executeUpdate(ps); 255 256 ps.close(); 256 257 bytes += rowsInserted * bytesPerRow; 257 258 totalInsertCount += rowsInserted; 259 } 260 catch (InterruptedException ex) 261 { 262 throw new SignalException("Aborted by user.", ex); 258 263 } 259 264 catch (SQLException ex) -
trunk/src/core/net/sf/basedb/core/PositionExtraValueBatcher.java
r4020 r4119 28 28 import net.sf.basedb.core.query.Expressions; 29 29 import net.sf.basedb.core.query.Selects; 30 import net.sf.basedb.core.signal.SignalException; 30 31 31 32 import java.util.List; … … 359 360 PreparedStatement ps = HibernateUtil.getConnection(getDbControl().getHibernateSession()).prepareStatement(insertSql); 360 361 query.setParameters(ps, parameterOrder); 361 rowsInserted = ps.executeUpdate();362 rowsInserted = QueryExecutor.executeUpdate(ps); 362 363 ps.close(); 363 364 bytes += rowsInserted * bytesPerRow; 364 365 totalInsertCount += rowsInserted; 366 } 367 catch (InterruptedException ex) 368 { 369 throw new SignalException("Aborted by user.", ex); 365 370 } 366 371 catch (SQLException ex) -
trunk/src/core/net/sf/basedb/core/SpotBatcher.java
r3775 r4119 28 28 import net.sf.basedb.core.query.Expressions; 29 29 import net.sf.basedb.core.query.Selects; 30 import net.sf.basedb.core.signal.SignalException; 30 31 31 32 import java.util.List; … … 340 341 PreparedStatement ps = HibernateUtil.getConnection(getDbControl().getHibernateSession()).prepareStatement(insertSql); 341 342 query.setParameters(ps, parameterOrder); 342 rowsInserted = ps.executeUpdate();343 rowsInserted = QueryExecutor.executeUpdate(ps); 343 344 ps.close(); 344 345 bytes += rowsInserted * bytesPerRow; 345 346 totalInsertCount += rowsInserted; 347 } 348 catch (InterruptedException ex) 349 { 350 throw new SignalException("Aborted by user.", ex); 346 351 } 347 352 catch (SQLException ex) -
trunk/src/core/net/sf/basedb/core/SpotExtraValueBatcher.java
r4023 r4119 28 28 import net.sf.basedb.core.query.Expressions; 29 29 import net.sf.basedb.core.query.Selects; 30 import net.sf.basedb.core.signal.SignalException; 30 31 31 32 import java.util.List; … … 347 348 PreparedStatement ps = HibernateUtil.getConnection(getDbControl().getHibernateSession()).prepareStatement(insertSql); 348 349 query.setParameters(ps, parameterOrder); 349 rowsInserted = ps.executeUpdate();350 rowsInserted = QueryExecutor.executeUpdate(ps); 350 351 ps.close(); 351 352 bytes += rowsInserted * bytesPerRow; 352 353 totalInsertCount += rowsInserted; 354 } 355 catch (InterruptedException ex) 356 { 357 throw new SignalException("Aborted by user.", ex); 353 358 } 354 359 catch (SQLException ex) -
trunk/src/core/net/sf/basedb/core/VirtualDb.java
r4023 r4119 28 28 import net.sf.basedb.core.data.VirtualDbData; 29 29 import net.sf.basedb.core.data.SharedData; 30 import net.sf.basedb.core.signal.SignalException; 30 31 31 32 import java.sql.Connection; … … 345 346 delete = c.prepareStatement(sql); 346 347 delete.setShort(1, cubeNo); 347 rowsDeleted += delete.executeUpdate(); 348 rowsDeleted += QueryExecutor.executeUpdate(delete); 349 } 350 catch (InterruptedException ex) 351 { 352 throw new SignalException("Aborted by user.", ex); 348 353 } 349 354 catch (SQLException ex) … … 392 397 delete.setShort(1, cubeNo); 393 398 delete.setShort(2, layerNo); 394 rowsDeleted += delete.executeUpdate(); 399 rowsDeleted += QueryExecutor.executeUpdate(delete); 400 } 401 catch (InterruptedException ex) 402 { 403 throw new SignalException("Aborted by user.", ex); 395 404 } 396 405 catch (SQLException ex) … … 438 447 delete.setShort(1, cubeNo); 439 448 delete.setShort(2, filterNo); 440 rowsDeleted += delete.executeUpdate(); 449 rowsDeleted += QueryExecutor.executeUpdate(delete); 450 } 451 catch (InterruptedException ex) 452 { 453 throw new SignalException("Aborted by user.", ex); 441 454 } 442 455 catch (SQLException ex) … … 485 498 delete.setShort(1, cubeNo); 486 499 delete.setShort(2, extraNo); 487 rowsDeleted += delete.executeUpdate(); 500 rowsDeleted += QueryExecutor.executeUpdate(delete); 501 } 502 catch (InterruptedException ex) 503 { 504 throw new SignalException("Aborted by user.", ex); 488 505 } 489 506 catch (SQLException ex) -
trunk/src/plugins/core/net/sf/basedb/plugins/LowessNormalization.java
r4118 r4119 445 445 446 446 DynamicResultIterator it = query.iterate(dc); 447 checkInterrupted();448 447 int positionIndex = it.getIndex(VirtualColumn.POSITION.getName()); 449 448 int ch1Index = it.getIndex("ch1"); … … 455 454 while (it.hasNext()) 456 455 { 456 checkInterrupted(); 457 457 SqlResult r = it.next(); 458 458 SpotData spot = new SpotData(r.getInt(positionIndex), … … 462 462 } 463 463 it.close(); 464 checkInterrupted();465 464 466 465 // Continue with next bioassay if there is no data … … 496 495 Collections.sort(toNormalize); 497 496 List<Double> smoothCurve = lowess(toNormalize, fitFraction, iterations, delta); 498 checkInterrupted();499 497 for (int j = 0; j < smoothCurve.size(); ++j) 500 498 { 499 checkInterrupted(); 501 500 SpotData spot = toNormalize.get(j); 502 501 double factor = Math.exp(smoothCurve.get(j) * 0.5); 503 502 batcher.insert(bioassayColumn, spot.position, (float)(spot.ch1/factor), (float)(spot.ch2*factor)); 504 503 } 505 checkInterrupted();506 504 normalizedSpots += smoothCurve.size(); 507 505 if (progress != null) progress.display((int)((normalizedSpots * 100L) / numSpots), normalizedSpots + " spots normalized");
Note: See TracChangeset
for help on using the changeset viewer.