コード例 #1
0
 public CustomerContact(string company, string firstName, string lastName, string email, string address,
                        string addressLine2, string city, string zipCode, string state, string country, string countryCode, string phone, string fax,
                        string mobile, string skypeName, string webSite, string userName, string password, string howFoundOther, int howFoundChoice,
                        SessionBase session)
 {
   this.company = company;
   this.firstName = firstName;
   this.lastName = lastName;
   this.email = email;
   this.address = address;
   this.addressLine2 = addressLine2;
   this.city = city;
   this.zipCode = zipCode;
   this.state = state;
   this.country = country;
   this.countryCode = countryCode;
   this.phone = phone;
   this.fax = fax;
   this.mobile = mobile;
   this.skypeName = skypeName;
   this.webSite = webSite;
   this.userName = userName;
   this.password = password;
   this.howFoundOther = howFoundOther;
   this.howFoundVelocityDb = (HowFound) howFoundChoice;
   priorVerifiedEmailSet = new SortedSetAny<string>();
 }
コード例 #2
0
 public CustomerContact(string company, string firstName, string lastName, string email, string address,
                        string addressLine2, string city, string zipCode, string state, string country, string countryCode, string phone, string fax,
                        string mobile, string skypeName, string webSite, string userName, string password, string howFoundOther, int howFoundChoice,
                        SessionBase session)
 {
     this.company            = company;
     this.firstName          = firstName;
     this.lastName           = lastName;
     this.email              = email;
     this.address            = address;
     this.addressLine2       = addressLine2;
     this.city               = city;
     this.zipCode            = zipCode;
     this.state              = state;
     this.country            = country;
     this.countryCode        = countryCode;
     this.phone              = phone;
     this.fax                = fax;
     this.mobile             = mobile;
     this.skypeName          = skypeName;
     this.webSite            = webSite;
     this.userName           = userName;
     this.password           = password;
     this.howFoundOther      = howFoundOther;
     this.howFoundVelocityDb = (HowFound)howFoundChoice;
     priorVerifiedEmailSet   = new SortedSetAny <string>();
 }
コード例 #3
0
 public CustomerContact(string company, string firstName, string lastName, string email, string address,
                        string addressLine2, string city, string zipCode, string state, string country, string countryCode, string phone, string fax,
                        string mobile, string skypeName, string webSite, string userName, string password, string howFoundOther, int howFoundChoice,
                        SessionBase session)
 {
     this.company            = company;
     this.firstName          = firstName;
     this.lastName           = lastName;
     this.email              = email;
     this.address            = address;
     this.addressLine2       = addressLine2;
     this.city               = city;
     this.zipCode            = zipCode;
     this.state              = state;
     this.country            = country;
     this.countryCode        = countryCode;
     this.phone              = phone;
     this.fax                = fax;
     this.mobile             = mobile;
     this.skypeName          = skypeName;
     this.webSite            = webSite;
     this.userName           = userName;
     this.password           = password;
     this.howFoundOther      = howFoundOther;
     this.howFoundVelocityDb = (HowFound)howFoundChoice;
     priorVerifiedEmailSet   = new SortedSetAny <string>();
     licenseSet              = new BTreeSet <License>(null, session);
     licenseRequestSet       = new BTreeSet <LicenseRequest>(null, session);
     licenseUnpaidSet        = new BTreeSet <License>(null, session);
     licenseUnpaidRequestSet = new BTreeSet <LicenseRequest>(null, session);
     licensePaymentSet       = new BTreeSet <LicensePayment>(null, session);
     CompareByField <VisitEvent> comparator = new CompareByField <VisitEvent>("eventTime", session);
     //visitEvents = new BTreeSet<VisitEvent>(comparator, session, 10000, sizeof(long), true);
 }
コード例 #4
0
ファイル: Person.cs プロジェクト: MerlinBrasil/VelocityDB
 public Person(string firstName, string lastName, ushort age, Person bestFriend = null)
 {
     this.firstName  = firstName;
     this.lastName   = lastName;
     this.age        = age;
     this.bestFriend = bestFriend;
     friends         = new SortedSetAny <Person>();
 }
コード例 #5
0
 public Person(string firstName, string lastName, ushort age, Person bestFriend = null)
 {
     m_firstName  = firstName;
     m_lastName   = lastName;
     m_age        = age;
     m_bestFriend = bestFriend;
     m_friends    = new SortedSetAny <Person>();
 }
コード例 #6
0
ファイル: Person.cs プロジェクト: MerlinBrasil/VelocityDB
 public Person(string firstName, string lastName, ushort age, Person bestFriend = null)
 {
   this.firstName = firstName;
   this.lastName = lastName;
   this.age = age;
   this.bestFriend = bestFriend;
   friends = new SortedSetAny<Person>();
 }
コード例 #7
0
ファイル: Person.cs プロジェクト: VelocityDB/VelocityDB
 public Person(string firstName, string lastName, ushort age, Person bestFriend = null)
 {
   m_firstName = firstName;
   m_lastName = lastName;
   m_age = age;
   m_bestFriend = bestFriend;
   m_friends = new SortedSetAny<Person>();
 }
コード例 #8
0
ファイル: TestCase.cs プロジェクト: MerlinBrasil/VelocityDB
 public void AddFile(string fileName)
 {
   FileInfo fileInfo = new FileInfo(fileName);
   FileData fileData = new FileData(fileInfo);
   if (testCaseFiles == null)
     testCaseFiles = new SortedSetAny<FileData>();
   testCaseFiles.Add(fileData);
   fileData.SetFileBytes();
 }
コード例 #9
0
 public UsingSortedSet(int addHowMany) 
 {
   intSortedSet = new SortedSetAny<int>(1);
   intList = new List<int>();
   for (int i = 0; i < addHowMany; i++)
   {
     int n = randGen.Next();
     intSortedSet.Add(n);
     intList.Add(n);
   }
 }
コード例 #10
0
ファイル: UsingSortedSet.cs プロジェクト: timotrob/VelocityDB
 public UsingSortedSet(int addHowMany)
 {
     intSortedSet = new SortedSetAny <int>(1);
     intList      = new List <int>();
     for (int i = 0; i < addHowMany; i++)
     {
         int n = randGen.Next();
         intSortedSet.Add(n);
         intList.Add(n);
     }
 }
コード例 #11
0
        public void AddFile(string fileName)
        {
            FileInfo fileInfo = new FileInfo(fileName);
            FileData fileData = new FileData(fileInfo);

            if (m_testCaseFiles == null)
            {
                m_testCaseFiles = new SortedSetAny <FileData>();
            }
            m_testCaseFiles.Add(fileData);
            fileData.SetFileBytes();
        }
コード例 #12
0
        public IssueTracker(int capacity, SessionBase session)
        {
            issueSetById = new SortedSetAny <Issue>(capacity);
            CompareByField <Issue> descriptionCompare = new CompareByField <Issue>("description", session, true);

            issueSetByDescription = new SortedSetAny <Issue>(descriptionCompare);
            ComparePriority priorityCompare = new ComparePriority();

            issueSetByPriority = new SortedSetAny <Issue>(priorityCompare);
            CompareByField <Issue> dateTimeCreatedCompare = new CompareByField <Issue>("dateTimeCreated", session, true);

            issueSetByDateTimeCreated = new SortedSetAny <Issue>(dateTimeCreatedCompare);
            CompareByField <Issue> dateTimeUpdatedCompare = new CompareByField <Issue>("dateTimeLastUpdated", session, true);

            issueSetByDateTimeUpdated = new SortedSetAny <Issue>(dateTimeCreatedCompare);
            CompareByField <Issue> compareStatus = new CompareByField <Issue>("status", session, true);

            issueSetByStatus = new SortedSetAny <Issue>(compareStatus);
            CompareSummary compareSummary = new CompareSummary();

            issueSetBySummary = new SortedSetAny <Issue>(compareSummary);
            CompareByField <Issue> compareProject = new CompareByField <Issue>("project", session, true);

            issueSetByProject = new SortedSetAny <Issue>(compareProject);
            CompareCategory compareCategory = new CompareCategory();

            issueSetByCategory = new SortedSetAny <Issue>(compareCategory);
            CompareReportedBy compareReportedBy = new CompareReportedBy();

            issueSetByReportedBy = new SortedSetAny <Issue>(compareReportedBy);
            CompareLastUpdatedBy compareLastUpdatedBy = new CompareLastUpdatedBy();

            issueSetByLastUpdatedBy = new SortedSetAny <Issue>(compareLastUpdatedBy);
            CompareAssignedTo compareAssignedTo = new CompareAssignedTo();

            issueSetByAssignedTo = new SortedSetAny <Issue>(compareAssignedTo);
            CompareByField <Issue> compareByDueDate = new CompareByField <Issue>("dueDate", session, true);

            issueSetByDueDate = new SortedSetAny <Issue>(compareByDueDate);
            CompareByVersion compareByVersion = new CompareByVersion();

            issueSetByVersion = new SortedSetAny <Issue>(compareByVersion);
            componentSet      = new SortedSetAny <Component>(capacity);
            userSet           = new SortedSetAny <User>(capacity);
            projectSet        = new SortedSetAny <Project>(capacity);
            versionSet        = new SortedSetAny <ProductVersion>(capacity);
            organizationSet   = new SortedSetAny <Organization>(capacity);
            permissions       = null;
        }
コード例 #13
0
 public PermissionScheme(User superUser)
 {
   this.m_superUser = superUser;
   m_adminSet = new SortedSetAny<User>();
   m_adminSet.Add(superUser);
   m_developerSet = new SortedSetAny<User>();
   m_adminPermissions = (uint) (Permission.CreateProject | Permission.DeleteProject | Permission.EditProject | Permission.CreateComponent | Permission.DeleteComponent | 
     Permission.EditComponent | Permission.CreateIssue | Permission.DeleteIssue | Permission.EditIssue | Permission.EditOwnIssue | Permission.DeleteOwnIssue | 
     Permission.CreateVersion | Permission.DeleteVersion | Permission.EditVersion | Permission.AddLargeAttachment | Permission.AddSmallAttachment |
     Permission.DeleteAttachment | Permission.LinkIssues | Permission.EditUser | Permission.ScheduleIssues | Permission.DeleteUser | Permission.WorkOnIssues);
   m_developerPermissions = (uint)(Permission.CreateIssue | Permission.DeleteIssue | Permission.EditIssue | Permission.EditOwnIssue | Permission.DeleteOwnIssue | 
     Permission.EditVersion | Permission.AddLargeAttachment | Permission.AddSmallAttachment |
     Permission.DeleteAttachment | Permission.LinkIssues | Permission.ScheduleIssues | Permission.WorkOnIssues);
   m_userPermissions = (uint)(Permission.CreateIssue | Permission.EditOwnIssue | Permission.DeleteOwnIssue | Permission.AddSmallAttachment);
 }
コード例 #14
0
 public PermissionScheme(User superUser)
 {
     this.m_superUser = superUser;
     m_adminSet       = new SortedSetAny <User>();
     m_adminSet.Add(superUser);
     m_developerSet     = new SortedSetAny <User>();
     m_adminPermissions = (uint)(Permission.CreateProject | Permission.DeleteProject | Permission.EditProject | Permission.CreateComponent | Permission.DeleteComponent |
                                 Permission.EditComponent | Permission.CreateIssue | Permission.DeleteIssue | Permission.EditIssue | Permission.EditOwnIssue | Permission.DeleteOwnIssue |
                                 Permission.CreateVersion | Permission.DeleteVersion | Permission.EditVersion | Permission.AddLargeAttachment | Permission.AddSmallAttachment |
                                 Permission.DeleteAttachment | Permission.LinkIssues | Permission.EditUser | Permission.ScheduleIssues | Permission.DeleteUser | Permission.WorkOnIssues);
     m_developerPermissions = (uint)(Permission.CreateIssue | Permission.DeleteIssue | Permission.EditIssue | Permission.EditOwnIssue | Permission.DeleteOwnIssue |
                                     Permission.EditVersion | Permission.AddLargeAttachment | Permission.AddSmallAttachment |
                                     Permission.DeleteAttachment | Permission.LinkIssues | Permission.ScheduleIssues | Permission.WorkOnIssues);
     m_userPermissions = (uint)(Permission.CreateIssue | Permission.EditOwnIssue | Permission.DeleteOwnIssue | Permission.AddSmallAttachment);
 }
コード例 #15
0
ファイル: Issue.cs プロジェクト: timotrob/VelocityDB
 public Issue(User reportedBy, PriorityEnum priority, Project project, CategoryEnum category, Component component, ProductVersion version, Resolution resolution,
              string summary, string description, string environment, User assignedTo, DateTime dueDate, SortedSetAny <Attachment> attachments, StatusEnum status = StatusEnum.Open)
 {
     if (attachments != null)
     {
         m_attachments = attachments;
     }
     else
     {
         m_attachments = new SortedSetAny <Attachment>();
     }
     m_reportedBy           = reportedBy;
     m_project              = project;
     m_component            = component;
     m_affectedComponentSet = new SortedSetAny <Component>(1);
     if (component != null)
     {
         m_affectedComponentSet.Add(component);
     }
     m_affectedVersionSet = new SortedSetAny <ProductVersion>(1);
     if (version != null)
     {
         m_affectedVersionSet.Add(version);
     }
     m_voteSet             = new SortedSetAny <Vote>(1);
     m_relatedIssueSet     = new SortedSetAny <Issue>(1);
     m_fixedInVersionSet   = new SortedSetAny <ProductVersion>(1);
     m_subTaskSet          = new SortedSetAny <SubTask>(1);
     m_labelSet            = new SortedSetAny <ProductLabel>(1);
     m_version             = version;
     m_summary             = summary;
     m_description         = description;
     m_environment         = environment;
     m_category            = category;
     m_priority            = priority;
     m_fixResolution       = resolution;
     m_dateTimeCreated     = DateTime.Now;
     m_dateTimeLastUpdated = m_dateTimeCreated;
     m_fixmessage          = null;
     m_lastUpdatedBy       = reportedBy;
     m_dueDate             = dueDate;
     m_status      = status;
     AssignedTo    = assignedTo;
     m_subscribers = null; // to do
     m_testCase    = null; // to do
 }
コード例 #16
0
ファイル: Issue.cs プロジェクト: MerlinBrasil/VelocityDB
 public Issue(User reportedBy, PriorityEnum priority, Project project, CategoryEnum category, Component component, ProductVersion version, Resolution resolution,
              string summary, string description, string environment, User assignedTo, DateTime dueDate, SortedSetAny <Attachment> attachments, StatusEnum status = StatusEnum.Open)
 {
     if (attachments != null)
     {
         this.attachments = attachments;
     }
     else
     {
         this.attachments = new SortedSetAny <Attachment>();
     }
     this.reportedBy      = reportedBy;
     this.project         = project;
     this.component       = component;
     affectedComponentSet = new SortedSetAny <Component>(1);
     if (component != null)
     {
         affectedComponentSet.Add(component);
     }
     affectedVersionSet = new SortedSetAny <ProductVersion>(1);
     if (version != null)
     {
         affectedVersionSet.Add(version);
     }
     voteSet             = new SortedSetAny <Vote>(1);
     relatedIssueSet     = new SortedSetAny <Issue>(1);
     fixedInVersionSet   = new SortedSetAny <ProductVersion>(1);
     subTaskSet          = new SortedSetAny <SubTask>(1);
     labelSet            = new SortedSetAny <ProductLabel>(1);
     this.version        = version;
     this.summary        = summary;
     this.description    = description;
     this.environment    = environment;
     this.category       = category;
     this.priority       = priority;
     fixResolution       = resolution;
     dateTimeCreated     = DateTime.Now;
     dateTimeLastUpdated = dateTimeCreated;
     fixmessage          = null;
     lastUpdatedBy       = reportedBy;
     this.dueDate        = dueDate;
     this.status         = status;
     this.AssignedTo     = assignedTo;
     subscribers         = null; // to do
     testCase            = null; // to do
 }
コード例 #17
0
ファイル: Issue.cs プロジェクト: MerlinBrasil/VelocityDB
 public Issue(User reportedBy, PriorityEnum priority, Project project, CategoryEnum category, Component component, ProductVersion version, Resolution resolution,
   string summary, string description, string environment, User assignedTo, DateTime dueDate, SortedSetAny<Attachment> attachments, StatusEnum status = StatusEnum.Open)
 {
   if (attachments != null)
     this.attachments = attachments;
   else
     this.attachments = new SortedSetAny<Attachment>();
   this.reportedBy = reportedBy;
   this.project = project;
   this.component = component;
   affectedComponentSet = new SortedSetAny<Component>(1);
   if (component != null)
     affectedComponentSet.Add(component);
   affectedVersionSet = new SortedSetAny<ProductVersion>(1);
   if (version != null)
     affectedVersionSet.Add(version);
   voteSet = new SortedSetAny<Vote>(1);
   relatedIssueSet = new SortedSetAny<Issue>(1);
   fixedInVersionSet = new SortedSetAny<ProductVersion>(1);
   subTaskSet = new SortedSetAny<SubTask>(1);
   labelSet = new SortedSetAny<ProductLabel>(1);
   this.version = version;
   this.summary = summary;
   this.description = description;
   this.environment = environment;
   this.category = category;
   this.priority = priority;
   fixResolution = resolution;
   dateTimeCreated = DateTime.Now;
   dateTimeLastUpdated = dateTimeCreated;
   fixmessage = null;
   lastUpdatedBy = reportedBy;
   this.dueDate = dueDate;
   this.status = status;
   this.AssignedTo = assignedTo;
   subscribers = null; // to do
   testCase = null;// to do
 }
コード例 #18
0
ファイル: Issue.cs プロジェクト: VelocityDB/VelocityDB
 public Issue(User reportedBy, PriorityEnum priority, Project project, CategoryEnum category, Component component, ProductVersion version, Resolution resolution,
   string summary, string description, string environment, User assignedTo, DateTime dueDate, SortedSetAny<Attachment> attachments, StatusEnum status = StatusEnum.Open)
 {
   if (attachments != null)
     m_attachments = attachments;
   else
     m_attachments = new SortedSetAny<Attachment>();
   m_reportedBy = reportedBy;
   m_project = project;
   m_component = component;
   m_affectedComponentSet = new SortedSetAny<Component>(1);
   if (component != null)
     m_affectedComponentSet.Add(component);
   m_affectedVersionSet = new SortedSetAny<ProductVersion>(1);
   if (version != null)
     m_affectedVersionSet.Add(version);
   m_voteSet = new SortedSetAny<Vote>(1);
   m_relatedIssueSet = new SortedSetAny<Issue>(1);
   m_fixedInVersionSet = new SortedSetAny<ProductVersion>(1);
   m_subTaskSet = new SortedSetAny<SubTask>(1);
   m_labelSet = new SortedSetAny<ProductLabel>(1);
   m_version = version;
   m_summary = summary;
   m_description = description;
   m_environment = environment;
   m_category = category;
   m_priority = priority;
   m_fixResolution = resolution;
   m_dateTimeCreated = DateTime.Now;
   m_dateTimeLastUpdated = m_dateTimeCreated;
   m_fixmessage = null;
   m_lastUpdatedBy = reportedBy;
   m_dueDate = dueDate;
   m_status = status;
   AssignedTo = assignedTo;
   m_subscribers = null; // to do
   m_testCase = null;// to do
 }
コード例 #19
0
 public IssueTracker(int capacity, SessionBase session)
 {
   issueSetById = new SortedSetAny<Issue>(capacity);
   CompareByField<Issue> descriptionCompare = new CompareByField<Issue>("description", session, true);
   issueSetByDescription = new SortedSetAny<Issue>(descriptionCompare); 
   ComparePriority priorityCompare = new ComparePriority();
   issueSetByPriority = new SortedSetAny<Issue>(priorityCompare);
   CompareByField<Issue> dateTimeCreatedCompare = new CompareByField<Issue>("dateTimeCreated", session, true);
   issueSetByDateTimeCreated = new SortedSetAny<Issue>(dateTimeCreatedCompare);
   CompareByField<Issue> dateTimeUpdatedCompare = new CompareByField<Issue>("dateTimeLastUpdated", session, true);
   issueSetByDateTimeUpdated = new SortedSetAny<Issue>(dateTimeCreatedCompare);
   CompareByField<Issue> compareStatus = new CompareByField<Issue>("status", session, true);
   issueSetByStatus = new SortedSetAny<Issue>(compareStatus);
   CompareSummary compareSummary = new CompareSummary();
   issueSetBySummary = new SortedSetAny<Issue>(compareSummary);
   CompareByField<Issue> compareProject = new CompareByField<Issue>("project", session, true);
   issueSetByProject = new SortedSetAny<Issue>(compareProject);
   CompareCategory compareCategory = new CompareCategory();
   issueSetByCategory = new SortedSetAny<Issue>(compareCategory);
   CompareReportedBy compareReportedBy = new CompareReportedBy();
   issueSetByReportedBy = new SortedSetAny<Issue>(compareReportedBy);
   CompareLastUpdatedBy compareLastUpdatedBy = new CompareLastUpdatedBy();
   issueSetByLastUpdatedBy = new SortedSetAny<Issue>(compareLastUpdatedBy);
   CompareAssignedTo compareAssignedTo = new CompareAssignedTo();
   issueSetByAssignedTo = new SortedSetAny<Issue>(compareAssignedTo);
   CompareByField<Issue> compareByDueDate = new CompareByField<Issue>("dueDate", session, true);
   issueSetByDueDate = new SortedSetAny<Issue>(compareByDueDate);
   CompareByVersion compareByVersion = new CompareByVersion();
   issueSetByVersion = new SortedSetAny<Issue>(compareByVersion);
   componentSet = new SortedSetAny<Component>(capacity);
   userSet = new SortedSetAny<User>(capacity);
   projectSet = new SortedSetAny<Project>(capacity);
   versionSet = new SortedSetAny<ProductVersion>(capacity);
   organizationSet = new SortedSetAny<Organization>(capacity);
   permissions = null;
 }
コード例 #20
0
ファイル: Issues.aspx.cs プロジェクト: VelocityDB/VelocityDB
 protected void UploadButton_Click(object sender, EventArgs e)
 {
   FileUpload file = (FileUpload)IssueDetailsView.FindControl("AttachmentFileUpload");
   if (file.HasFile)
   {
     HttpPostedFile postedFile = file.PostedFile;
     TextBox fileInfoTextBox = (TextBox)IssueDetailsView.FindControl("UploadTextBox");
     ListBox listBox = (ListBox)IssueDetailsView.FindControl("UploadsListBox");
     Attachment attachment = new Attachment(postedFile.FileName, file.FileName, fileInfoTextBox.Text, file.FileBytes, postedFile.ContentType, null);
     listBox.Items.Add(new ListItem(attachment.ToString(), attachment.FileName));
     SortedSetAny<Attachment> attachments;
     object updatedAttachments = Session["UpdatedAttachments"];
     if (updatedAttachments == null)
     {
       attachments = new SortedSetAny<Attachment>();
       Session["UpdatedAttachments"] = attachments;
     }
     else
       attachments = (SortedSetAny<Attachment>)updatedAttachments;
     attachments.Add(attachment);
     updateImage(0, attachment.FileName);
   }
 }
コード例 #21
0
 public void Recover1(SessionBase session)
 {
   Database db = null;
   session.BeginUpdate();
   db = session.OpenDatabase(88, true, false);
   if (db != null)
     session.DeleteDatabase(db);
   db = session.OpenDatabase(89, true, false);
   if (db != null)
     session.DeleteDatabase(db);
   session.Commit();
   session.BeginUpdate();
   db = session.NewDatabase(88);
   session.FlushUpdates();
   session.Abort();
   session.BeginUpdate();
   db = session.NewDatabase(88);
   SortedSetAny<float> floatSet;
   Oid floatSetOid;
   string dbPath = System.IO.Path.Combine(systemDir, "89.odb");
   Placement place = new Placement(88);
   for (int i = 0; i < 10; i++)
   {
     floatSet = new SortedSetAny<float>();
     floatSet.Persist(place, session);
     floatSetOid = floatSet.Oid;
   }
   db = session.NewDatabase(89);
   session.Commit();
   File.Delete(dbPath);
   session.BeginUpdate();
   db = session.NewDatabase(89);
   session.Commit();
   FileInfo info = new FileInfo(dbPath);
   info.CopyTo(dbPath + "X");
   session.BeginUpdate();
   SortedSetAny<int> intSet;
   place = new Placement(89);
   for (int i = 0; i < 10; i++)
   {
     intSet = new SortedSetAny<int>();
     intSet.Persist(place, session);
   }
   db = session.OpenDatabase(88);
   var list = db.AllObjects<SortedSetAny<float>>();
   foreach (SortedSetAny<float> set in list)
     set.Unpersist(session);
   db = session.OpenDatabase(89);
   session.Commit();
   intSet = null;
   db = null; // release refs so that cached data isn't stale
   File.Delete(dbPath);
   info = new FileInfo(dbPath + "X");
   info.MoveTo(dbPath);
   session.BeginUpdate();
   intSet = (SortedSetAny<int>)session.Open(89, 1, 1, false);
   Debug.Assert(intSet == null);
   object o = session.Open(88, 1, 1, false);
   floatSet = (SortedSetAny<float>)o;
   Debug.Assert(floatSet != null);
   session.Commit();
   session.BeginUpdate();
   db = session.OpenDatabase(88);
   session.DeleteDatabase(db);
   db = session.OpenDatabase(89);
   session.DeleteDatabase(db);
   session.Commit();
 }
コード例 #22
0
        public void Recover1(SessionBase session)
        {
            Database db = null;

            session.BeginUpdate();
            session.RegisterClass(typeof(SortedSetAny <int>));
            session.RegisterClass(typeof(SortedSetAny <float>));
            db = session.OpenDatabase(88, true, false);
            if (db != null)
            {
                session.DeleteDatabase(db);
            }
            db = session.OpenDatabase(89, true, false);
            if (db != null)
            {
                session.DeleteDatabase(db);
            }
            session.Commit();
            session.BeginUpdate();
            db = session.NewDatabase(88);
            session.FlushUpdates();
            session.Abort();
            session.BeginUpdate();
            db = session.NewDatabase(88);
            SortedSetAny <float> floatSet;
            Oid       floatSetOid;
            string    dbPath = System.IO.Path.Combine(systemDir, "89.odb");
            Placement place  = new Placement(88);

            for (int i = 0; i < 10; i++)
            {
                floatSet = new SortedSetAny <float>();
                floatSet.Persist(place, session);
                floatSetOid = floatSet.Oid;
            }
            db = session.NewDatabase(89);
            session.Commit();
            File.Delete(dbPath);
            session.BeginUpdate();
            db = session.NewDatabase(89);
            session.Commit();
            FileInfo info = new FileInfo(dbPath);

            info.CopyTo(dbPath + "X");
            session.BeginUpdate();
            SortedSetAny <int> intSet;

            place = new Placement(89);
            for (int i = 0; i < 10; i++)
            {
                intSet = new SortedSetAny <int>();
                intSet.Persist(place, session);
            }
            db = session.OpenDatabase(88);
            var list = db.AllObjects <SortedSetAny <float> >();

            foreach (SortedSetAny <float> set in list)
            {
                set.Unpersist(session);
            }
            db = session.OpenDatabase(89);
            session.Commit();
            intSet = null;
            db     = null; // release refs so that cached data isn't stale
            File.Delete(dbPath);
            info = new FileInfo(dbPath + "X");
            info.MoveTo(dbPath);
            session.BeginUpdate();
            intSet = (SortedSetAny <int>)session.Open(89, 1, 1, false);
            Debug.Assert(intSet == null);
            object o = session.Open(88, 1, 1, false);

            floatSet = (SortedSetAny <float>)o;
            Debug.Assert(floatSet != null);
            session.Checkpoint();
            db = session.OpenDatabase(88);
            session.DeleteDatabase(db);
            db = session.OpenDatabase(89);
            session.DeleteDatabase(db);
            session.Commit();
        }