Results 1 to 2 of 2

Thread: Force delete a table raw file

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

    Default Force delete a table raw file

    Hi,

    Any option available to force delete the table raw file? I am using below code to delete the XTable and associated raw file -
     
    XTable table = engine.Scheme.OpenXTable(new Locator(tableName));
    //delete the XTable from the Scheme
    engine.Scheme.Delete(loc);
    //commit changes in the Scheme
    engine.Scheme.Commit();
    table.Commit();
    table.Close();
    table.RawFile.Close();
     
    //delete the RawFile holding the XTable 
    engine.FileSystem.DeleteFile(table.RawFile.Handle);
    
    Problem occurs if any previous code has opened the same table and hasn't called table.Close(). So rawFile.References does not decrement and we get "File is opened." exception.
    I understand this is more of coding issue but there could be situation where we need to forcefully remove the table and underlying raw file. Any option available for this situation?

  2. #2

    Default

    table.Close() does not invoke table.RawFile.Close() method, which decrements the table.RawFile.References. (http://stssoft.com/forum/threads/160-Dropping-an-XTable)
    (EDIT: the above behavior is changed in STSdb R3.5.12)

    Forcefully delete of an underlying RawFile is not possible.
    Last edited by p.petkov; 04.12.2014 at 15:55.

Tags for this Thread

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.