Changeset 4629 for branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess
- Timestamp:
- 10/20/10 15:05:55 (14 years ago)
- Location:
- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3
- Files:
-
- 5 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3
- Property svn:ignore
-
old new 1 1 bin 2 2 obj 3 *.user
-
- Property svn:ignore
-
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/ContextFactory.cs
r4598 r4629 75 75 transactions.Add(threadId, transaction); 76 76 } 77 return context;77 return disposableContext; 78 78 } 79 79 } … … 96 96 lock (locker) { 97 97 int threadId = Thread.CurrentThread.ManagedThreadId; 98 contexts[threadId]. Dispose();98 contexts[threadId].Obj.Dispose(); 99 99 contexts.Remove(threadId); 100 100 // context gets disposed implicitly, when it is used as IDisposable -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HeuristicLab.Services.Hive.DataAccess-3.3.csproj
r4615 r4629 30 30 <ErrorReport>prompt</ErrorReport> 31 31 <WarningLevel>4</WarningLevel> 32 </PropertyGroup> 33 <PropertyGroup> 34 <SignAssembly>true</SignAssembly> 35 </PropertyGroup> 36 <PropertyGroup> 37 <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile> 32 38 </PropertyGroup> 33 39 <ItemGroup> … … 75 81 <DependentUpon>Settings.settings</DependentUpon> 76 82 </Compile> 83 <Compile Include="Tools\CreateHiveDatabaseApplication.cs" /> 77 84 </ItemGroup> 78 85 <ItemGroup> … … 83 90 <SubType>Designer</SubType> 84 91 </None> 92 <None Include="HeuristicLab.snk" /> 85 93 <None Include="HiveDataContext.dbml"> 86 94 <Generator>MSLinqToSQLGenerator</Generator> … … 104 112 </ProjectReference> 105 113 </ItemGroup> 114 <ItemGroup> 115 <Content Include="Tools\cleanHiveDatabase.sql" /> 116 <Content Include="Tools\prepareHiveDatabase.sql" /> 117 </ItemGroup> 106 118 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 107 119 <PropertyGroup> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/HiveDao.cs
r4615 r4629 58 58 orderby ar.Job.Priority descending 59 59 select Convert.ToDto(ar.Job); 60 return query.ToArray(); 60 return query; 61 } 62 63 public IEnumerable<DT.Job> GetAvailableJobs(DT.Slave slave) { 64 var query = from j in db.Jobs 65 where j.JobState == JobState.Waiting && j.CoresNeeded <= slave.FreeCores && j.MemoryNeeded <= slave.FreeMemory 66 orderby j.Priority descending 67 select Convert.ToDto(j); 68 return query.Union(GetAvailableParentJobs(slave.Id)).OrderByDescending(x => x.Priority).ToArray(); 61 69 } 62 70 #endregion … … 217 225 public bool IsUserAuthorizedForJobs(Guid userId, params Guid[] jobIds) { 218 226 var userIds = from job in db.Jobs // this needs to be fast! 219 where jobIds.Contains(job.JobId)220 select job.UserId;227 where jobIds.Contains(job.JobId) 228 select job.UserId; 221 229 return userIds.All(x => x == userId); 222 230 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive.New/HeuristicLab.Services.Hive.DataAccess/3.3/Interfaces/IHiveDao.cs
r4615 r4629 15 15 void UpdateJob(DT.Job dto); 16 16 void DeleteJob(Guid id); 17 IEnumerable<DT.Job> GetAvailable ParentJobs(Guid slaveId);17 IEnumerable<DT.Job> GetAvailableJobs(DT.Slave slave); 18 18 #endregion 19 19
Note: See TracChangeset
for help on using the changeset viewer.