Changeset 504 for trunk/sources/HeuristicLab.Grid/Database.cs
- Timestamp:
- 08/12/08 15:38:27 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Grid/Database.cs
r502 r504 274 274 } 275 275 276 internal long GetJobCount(JobState status) { 277 rwLock.EnterReadLock(); 278 try { 279 using(SQLiteConnection cnn = new SQLiteConnection(connectionString)) { 280 cnn.Open(); 281 DbCommand c = cnn.CreateCommand(); 282 c.CommandText = "Select Count(id) from Job where Status=@Status"; 283 DbParameter stateParameter = c.CreateParameter(); 284 stateParameter.ParameterName = "@Status"; 285 stateParameter.Value = status.ToString(); 286 c.Parameters.Add(stateParameter); 287 return (long)c.ExecuteScalar(); 288 } 289 } finally { 290 rwLock.ExitReadLock(); 291 } 292 } 293 276 294 /// <summary> 277 295 /// Does nothing right now (= running jobs that disappear are never restarted).
Note: See TracChangeset
for help on using the changeset viewer.