Results 1 to 2 of 2

Thread: InvalidOperationException ("Count > 0") in FTables.cs

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    2

    Default InvalidOperationException("Count > 0") in FTables.cs

    Hi Team,

    We are using licensed ver 3.5.12 and in one particular scenario getting InvalidOperationException("Count > 0") at FTables.cs (property setter Depth).
    I would like to know what is the significance of this check?
    Is there any way to recover/ repair the error causing table? We tried compact operation but it fails again at the same point.
    Can you please guide.

  2. #2

    Default

    The InvalidOperationException is throwed when the engine tries to set the Depth property of a non-empty FTable (in 3.5.x each XTable is actually a group of FTables). In general this is an internal check and it is for developer purposes only. However, such check should be made for the internal user FTables, but not for the internal journal FTable of the opened XTable. So, this is a bug.

    This situation occurs when the Commit of the specified XTable is not completed successfully (during power down or for some other reasons). In such case, when the XTable is opened again, its internal journal FTable is not empty and the engine must do some work to rollback the XTable to the state of the last successful commit.

    If you have the 3.5.12 source code and can't wait, please just comment this check in the FTable.cs in the Depth property setter:
    //if (Count != 0)
    //    throw new InvalidOperationException("Count > 0");
    
    After that in your database the table should be in the state of its last successful commit.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
2002 - 2014 STS Soft SC. All Rights reserved.
STSdb, Waterfall Tree and WTree are registered trademarks of STS Soft SC.