Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4137


Ignore:
Timestamp:
08/03/10 13:42:10 (14 years ago)
Author:
cneumuel
Message:

use no transactions in read-only service calls to avoid dead-locks (#1092)

Location:
branches/3.3-HiveMigration/sources/HeuristicLab.Hive
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Client.Console/3.3/HiveClientConsole.cs

    r4107 r4137  
    109109
    110110    private void InitLogFileReader() {
    111       logFileReader = new LogFileReader(Environment.CurrentDirectory + @"/Hive.log");
     111      logFileReader = new LogFileReader(AppDomain.CurrentDomain.BaseDirectory + @"/Hive.Client.log");
    112112      logFileReader.MoreData += new LogFileReader.MoreDataHandler(logFileReader_MoreData);
    113113      logFileReader.Start();
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ExecutionEngineFacade.cs

    r4121 r4137  
    5959
    6060    public ResponseObject<SerializedJob> GetLastSerializedResult(Guid jobId, bool requested, bool snapshot) {
    61       using (contextFactory.GetContext()) {
     61      using (contextFactory.GetContext(false)) {
    6262        return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
    6363      }
     
    6565
    6666    public ResponseObject<JobDto> GetJobById(Guid jobId) {
    67       using (contextFactory.GetContext()) {
     67      using (contextFactory.GetContext(false)) {
    6868        return jobManager.GetJobById(jobId);
    6969      }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/Facades/ServerConsoleFacade.cs

    r4133 r4137  
    4949
    5050    public Response Login(string username, string password) {
    51       using (contextFactory.GetContext()) {
    52         Response resp = new Response();
    53 
    54         sessionID = secMan.Login(username, password);
    55         if (sessionID == Guid.Empty) {
    56           resp.Success = false;
    57           resp.StatusMessage = ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_FAILED;
    58         } else {
    59           resp.Success = true;
    60           resp.StatusMessage =
    61             ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_SUCCESS;
    62         }
    63         return resp;
    64       }
     51      Response resp = new Response();
     52
     53      sessionID = secMan.Login(username, password);
     54      if (sessionID == Guid.Empty) {
     55        resp.Success = false;
     56        resp.StatusMessage = ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_FAILED;
     57      } else {
     58        resp.Success = true;
     59        resp.StatusMessage =
     60          ApplicationConstants.RESPONSE_SERVERCONSOLE_LOGIN_SUCCESS;
     61      }
     62      return resp;
    6563    }
    6664
    6765
    6866    public ResponseList<ClientDto> GetAllClients() {
    69       using (contextFactory.GetContext()) {
     67      using (contextFactory.GetContext(false)) {
    7068        secMan.Authorize("AccessClients", sessionID, Guid.Empty);
    7169        return clientManager.GetAllClients();
     
    7472
    7573    public ResponseList<ClientGroupDto> GetAllClientGroups() {
    76       using (contextFactory.GetContext()) {
     74      using (contextFactory.GetContext(false)) {
    7775        //secMan.Authorize("AccessClientGroup", sessionID, Guid.Empty);
    7876        return clientManager.GetAllClientGroups();
     
    8179
    8280    public ResponseList<UpTimeStatisticsDto> GetAllUpTimeStatistics() {
    83       using (contextFactory.GetContext()) {
     81      using (contextFactory.GetContext(false)) {
    8482        secMan.Authorize("AccessStatistics", sessionID, Guid.Empty);
    8583        return clientManager.GetAllUpTimeStatistics();
     
    108106
    109107    public ResponseList<JobDto> GetAllJobs() {
    110       using (contextFactory.GetContext()) {
     108      using (contextFactory.GetContext(false)) {
    111109        secMan.Authorize("AccessJobs", sessionID, Guid.Empty);
    112110        return jobManager.GetAllJobs();
     
    115113
    116114    public ResponseList<JobDto> GetAllJobsWithFilter(State jobState, int offset, int count) {
    117       using (contextFactory.GetContext()) {
     115      using (contextFactory.GetContext(false)) {
    118116        secMan.Authorize("AccessJobs", sessionID, Guid.Empty);
    119117        return jobManager.GetAllJobsWithFilter(jobState, offset, count);
     
    122120
    123121    public ResponseObject<JobDto> GetJobById(Guid jobId) {
    124       using (contextFactory.GetContext()) {
     122      using (contextFactory.GetContext(false)) {
    125123        secMan.Authorize("AccessJobs", sessionID, jobId);
    126124        return jobManager.GetJobById(jobId);
     
    129127
    130128    public ResponseObject<JobDto> GetJobByIdWithDetails(Guid jobId) {
    131       using (contextFactory.GetContext()) {
     129      using (contextFactory.GetContext(false)) {
    132130        secMan.Authorize("AccessJobs", sessionID, jobId);
    133131        return jobManager.GetJobByIdWithDetails(jobId);
     
    143141
    144142    public ResponseObject<JobDto> GetLastJobResultOf(Guid jobId) {
    145       using (contextFactory.GetContext()) {
     143      using (contextFactory.GetContext(false)) {
    146144        secMan.Authorize("AccessJobResults", sessionID, jobId);
    147145        return jobManager.GetLastJobResultOf(jobId);
     
    150148
    151149    public ResponseObject<SerializedJob> GetLastSerializedJobResultOf(Guid jobId, bool requested, bool snapshot) {
    152       using (contextFactory.GetContext()) {
     150      using (contextFactory.GetContext(false)) {
    153151        secMan.Authorize("AccessJobResults", sessionID, jobId);
    154152        return jobManager.GetLastSerializedJobResultOf(jobId, requested, snapshot);
     
    157155
    158156    public ResponseList<JobResult> GetAllJobResults(Guid jobId) {
    159       using (contextFactory.GetContext()) {
     157      using (contextFactory.GetContext(false)) {
    160158        secMan.Authorize("AccessJobResults", sessionID, jobId);
    161159        return jobManager.GetAllJobResults(jobId);
     
    185183
    186184    public ResponseObject<ClientGroupDtoList> GetAllGroupsOfResource(Guid resourceId) {
    187       using (contextFactory.GetContext()) {
     185      using (contextFactory.GetContext(false)) {
    188186        secMan.Authorize("AccessUserGroup", sessionID, Guid.Empty);
    189187        return clientManager.GetAllGroupsOfResource(resourceId);
     
    199197
    200198    public ResponseList<ProjectDto> GetAllProjects() {
    201       using (contextFactory.GetContext()) {
     199      using (contextFactory.GetContext(false)) {
    202200        secMan.Authorize("AccessProjects", sessionID, Guid.Empty);
    203201        return jobManager.GetAllProjects();
     
    227225
    228226    public ResponseList<JobDto> GetJobsByProject(Guid projectId) {
    229       using (contextFactory.GetContext()) {
     227      using (contextFactory.GetContext(false)) {
    230228        secMan.Authorize("AccessJobs", sessionID, Guid.Empty);
    231229        return jobManager.GetJobsByProject(projectId);
     
    234232
    235233    public ResponseList<AppointmentDto> GetUptimeCalendarForResource(Guid guid) {
    236       using (contextFactory.GetContext()) {
     234      using (contextFactory.GetContext(false)) {
    237235        return clientManager.GetUptimeCalendarForResource(guid);
    238236      }
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Tracing/3.3/MethodCallPatternConverter.cs

    r4136 r4137  
    1111      StackTrace callStack = new StackTrace();
    1212      int i = 1;
    13       while (i <= callStack.FrameCount && !callStack.GetFrame(i).GetMethod().DeclaringType.FullName.StartsWith("HeuristicLab.Hive")) {
     13      while (i < callStack.FrameCount && !callStack.GetFrame(i).GetMethod().DeclaringType.FullName.StartsWith("HeuristicLab.Hive")) {
    1414        i++;
    1515      }
    16       StackFrame stack = new StackFrame(i);     
    17       writer.Write(stack.GetMethod().Name);           
     16      StackFrame stack = new StackFrame(i);
     17      var method = stack.GetMethod();
     18      if (method != null) {
     19        writer.Write(stack.GetMethod().Name);
     20      }
    1821    }
    1922  }
Note: See TracChangeset for help on using the changeset viewer.