| Author |  | 
      
        | hörnchenmeister Newbie
 
  
  
 Joined: 09 March 2011
 Location: Germany
 Online Status: Offline
 Posts: 8
 | 
          Hi all,
           | Posted: 09 March 2011 at 2:25am | IP Logged |   |  
           | 
 |  I am facing a problem when trying to save the bayes database to disk.
 
 I have an application where users can select mails from a list and mark them as spam/ham. Marking them as spam will result in a call to the TrainFilter method.
 
 As long as only one mail is selected the call succeeds. If the user has multiple mails selected the call fails with the following error:
 
 MailBee.MailBeeIOException: IOException occurred
 The process cannot access the file 'ham.dat' because it is being used by another process.
 
 The file resides on a network share.
 
 Calls to the TrainFilter method are made like this:
 
 void MarkAsSpam()
 {
 - Load database
 - TrainFilter
 - Save database
 - setting filter to null
 }
 
 I assumed at least after setting the filter to null and leaving the scope that the file would be freed again, but as soon as the loop executes the second time (sometimes it takes more loops until the error occurs) it fails.
 
 Any advise is kindly appreciated,
 best regards
 Andy
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Have reported this to the developers. Will let you know once there are news from them.
           | Posted: 09 March 2011 at 3:19am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | hörnchenmeister Newbie
 
  
  
 Joined: 09 March 2011
 Location: Germany
 Online Status: Offline
 Posts: 8
 | 
          Thank you Igor, I really appreciate it.
           | Posted: 09 March 2011 at 8:09am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | hörnchenmeister Newbie
 
  
  
 Joined: 09 March 2011
 Location: Germany
 Online Status: Offline
 Posts: 8
 | 
          
           | Posted: 17 March 2011 at 8:22am | IP Logged |   |  
           | 
 |  
| Igor wrote: 
 
    
    | 
      
       | Have reported this to the developers. Will let you know once there are news from them. 
 --
 Regards,
 Igor, AfterLogic Support
 |  |  |  
 
 Hi Igor,
 is there any progress regarding this problem?
 
 best regards
 Andy
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Intermediate update of the DLL is available:
           | Posted: 17 March 2011 at 8:29am | IP Logged |   |  
           | 
 |  
 http://www.afterlogic.com/updates/mailbee_net_2.zip
 
 Try it and let us know if the update helps. Thank you!
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | hörnchenmeister Newbie
 
  
  
 Joined: 09 March 2011
 Location: Germany
 Online Status: Offline
 Posts: 8
 | 
          Hi Igor,
           | Posted: 17 March 2011 at 8:47am | IP Logged |   |  
           | 
 |  thanks a lot for the prompt reply.
 
 I replaced out version 6.6 with the one I downloaded (MailBee.NET (6.7.2.280)), unfortunately it still throws this error (I had to translate it to english):
 Message: MailBee.MailBeeIOException: IOException occurred. InnerException message follows: The Process can not access file "\\share1\ham.dat" because it is used by another process. ---> System.IO.IOException: The Process can not access file "\\share1\ham.dat" because it is used by another process.     bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)     bei System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)     bei System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)     bei System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)     bei he.a(String A_0, Boolean A_1)     --- Ende der internen Ausnahmestapelüberwachung ---     bei he.a(String A_0, Boolean A_1)     bei MailBee.AntiSpam.BayesFilter.SaveDatabase(String spamFilename, String nonSpamFilename, Int32 threshold, Boolean saveAlways)     bei MailBee.AntiSpam.BayesFilter.SaveDatabase(String spamFilename, String nonSpamFilename)
 
 Let me know if I can provide additional information
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Got it. Have forwarded this to the developer, will keep you posted.
           | Posted: 17 March 2011 at 8:50am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | hörnchenmeister Newbie
 
  
  
 Joined: 09 March 2011
 Location: Germany
 Online Status: Offline
 Posts: 8
 | 
          Thanks a lot Igor ;)
           | Posted: 17 March 2011 at 8:56am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          I believe you'd be pleased to know that new API is implemented in current build of MailBee.NET Objects, it
           | Posted: 25 March 2011 at 7:20am | IP Logged |   |  
           | 
 |  includes a delegate which can check if the file is locked so based on the result you can decide whether you
 should proceed with saving or not. Please check this documentation page.
 
 Hope this helps!
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | hörnchenmeister Newbie
 
  
  
 Joined: 09 March 2011
 Location: Germany
 Online Status: Offline
 Posts: 8
 | 
          Hi Igor,
           | Posted: 07 April 2011 at 3:54am | IP Logged |   |  
           | 
 |  Thanks a lot for this information.
 I'll try to implement it right away.
 
 have a great day and thank you for your support,
 best regards
 Andy
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | halwits2011 Newbie
 
  
 
 Joined: 22 September 2011
 Location: India
 Online Status: Offline
 Posts: 5
 | 
          Its a great and very useful for us.
           | Posted: 22 September 2011 at 10:44pm | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  |