Revision 2280d0f8

b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
157 157
            get { return _selectedTab; }
158 158
            set
159 159
            {
160
                _selectedTab = value??"General";
160
                _selectedTab = value??"GeneralTab";
161 161
                NotifyOfPropertyChange(()=>SelectedTab);
162 162
                NotifyOfPropertyChange(() => AccountTabSelected);
163 163
            }
b/trunk/Pithos.Core/Agents/StatusAgent.cs
317 317

  
318 318
                try
319 319
                {
320
                    
321
                    using (var connection = GetConnection())
322
                    using (
323
                        var command = new SQLiteCommand("update FileState set FileStatus= :fileStatus where Id = :id  ",
324
                                                        connection))
325
                    {                                                
326
                        command.Parameters.AddWithValue("fileStatus", status);
320
                    using (var session = ActiveRecordMediator.GetSessionFactoryHolder().CreateSession(typeof(FileState)))
321
                    {
322
                        var walquery = session.CreateSQLQuery("PRAGMA journal_mode=WAL");
323
                        walquery.List();
327 324

  
328
                        command.Parameters.AddWithValue("id", id);
329
                        
330
                        var affected = command.ExecuteNonQuery();
325
                          var updatecmd = session.CreateSQLQuery(
326
                            "update FileState set FileStatus= :fileStatus where Id = :id  ")
327
                            .SetGuid("id", id)
328
                            .SetEnum("fileStatus", status);
329
                        var affected = updatecmd.ExecuteUpdate();
331 330
                        
332 331
                        return affected;
333 332
                    }
......
347 346
            {
348 347

  
349 348
                try
350
                {
351

  
352
                    using (var connection = GetConnection())
353
                    using (
354
                        var command =
355
                            new SQLiteCommand("update FileState set FileStatus= :fileStatus where FilePath = :path COLLATE NOCASE",
356
                                              connection))
349
                {                    
350
                    using (var session = ActiveRecordMediator.GetSessionFactoryHolder().CreateSession(typeof(FileState)))
351
                    using (session.BeginTransaction(IsolationLevel.ReadCommitted))
357 352
                    {
358
                        //var query=new HqlBasedQuery(typeof(FileState),)
359
                        //FileState.ExecuteQuery()
360
                        command.Parameters.AddWithValue("fileStatus", status);
361 353

  
362
                        command.Parameters.AddWithValue("path", path);
363
                        
364
                        var affected = command.ExecuteNonQuery();
354
                        var walquery = session.CreateSQLQuery("PRAGMA journal_mode=WAL");
355
                        walquery.List();
356

  
357
                        var updatecmd = session.CreateSQLQuery(
358
                            "update FileState set FileStatus= :fileStatus where FilePath = :path COLLATE NOCASE")
359
                            .SetString("path", path)
360
                            .SetEnum("fileStatus", status);
361
                        var affected = updatecmd.ExecuteUpdate();
362

  
365 363
                        if (affected == 0)
366 364
                        {                            
367 365
                            var createdState = FileState.CreateFor(FileInfoExtensions.FromPath(path), StatusNotification);
368 366
                            createdState.FileStatus = status;
369
                            createdState.Create();
367
                            session.Save(createdState);
370 368
                        }
371 369
                        return affected;
372 370
                    }

Also available in: Unified diff