Changeset 2082 for trunk/sources/HeuristicLab.Hive.Server.ADODataAccess
- Timestamp:
- 06/23/09 11:35:41 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/ClientAdapter.cs
r1999 r2082 189 189 190 190 public ClientInfo GetByName(string name) { 191 ClientInfo client = new ClientInfo(); 192 Resource res = 193 ResAdapter.GetByName(name); 194 195 return GetById(res.Id); 191 return (ClientInfo) 192 base.doInTransaction( 193 delegate() { 194 ClientInfo client = new ClientInfo(); 195 Resource res = 196 ResAdapter.GetByName(name); 197 198 return GetById(res.Id); 199 }); 196 200 } 197 201 198 202 protected override bool doDelete(ClientInfo client) { 199 bool success = false; 200 201 if (client != null) { 202 dsHiveServer.ClientRow row = 203 GetRowById(client.Id); 204 205 if (row != null) { 206 success = base.doDelete(client) && 207 ResAdapter.Delete(client); 208 } 209 } 210 211 return success; 203 return (bool)base.doInTransaction( 204 delegate() { 205 bool success = false; 206 207 if (client != null) { 208 dsHiveServer.ClientRow row = 209 GetRowById(client.Id); 210 211 if (row != null) { 212 success = base.doDelete(client) && 213 ResAdapter.Delete(client); 214 } 215 } 216 217 return success; 218 }); 212 219 } 213 220 -
trunk/sources/HeuristicLab.Hive.Server.ADODataAccess/3.2/JobAdapter.cs
r2066 r2082 166 166 job.Percentage = 0.0; 167 167 168 if (!row.IsSerializedJobNull())169 job.SerializedJob = row.SerializedJob;170 else171 job.SerializedJob = null;172 173 168 if (!row.IsDateCreatedNull()) 174 169 job.DateCreated = row.DateCreated; … … 255 250 256 251 row.Percentage = job.Percentage; 257 258 row.SerializedJob = job.SerializedJob;259 252 260 253 if (job.DateCreated != DateTime.MinValue) … … 422 415 } 423 416 417 /// <summary> 418 /// Gets the computable job with the secified jobId 419 /// </summary> 420 /// <param name="jobId"></param> 421 /// <returns></returns> 422 public ComputableJob GetComputableJob(Guid jobId) { 423 return (ComputableJob)base.doInTransaction( 424 delegate() { 425 ComputableJob job = 426 new ComputableJob(); 427 428 job.JobInfo = GetById(jobId); 429 dsHiveServer.JobRow row 430 = GetRowById(jobId); 431 432 if (job.JobInfo != null && row != null && 433 !row.IsSerializedJobNull()) { 434 435 job.SerializedJob = 436 row.SerializedJob; 437 438 return job; 439 } else { 440 return null; 441 } 442 }); 443 } 444 445 /// <summary> 446 /// Saves or update the computable job 447 /// </summary> 448 /// <param name="jobId"></param> 449 public void UpdateComputableJob(ComputableJob job) { 450 if(job != null && 451 job.JobInfo != null) { 452 base.doInTransaction( 453 delegate() { 454 dsHiveServer.JobRow row 455 = GetRowById(job.JobInfo.Id); 456 457 if (row != null) { 458 Update(job.JobInfo); 459 row.SerializedJob = 460 job.SerializedJob; 461 462 base.Adapter.Update(row); 463 } 464 465 return true; 466 }); 467 } 468 469 } 470 424 471 #endregion 425 472 }
Note: See TracChangeset
for help on using the changeset viewer.