gsi-upm / senpy

A sentiment and emotion analysis server in Python
http://senpy.gsi.upm.es
Apache License 2.0
71 stars 25 forks source link

Deadlock in ShelfPlugin #3

Closed balkian closed 8 years ago

balkian commented 8 years ago

When a shelf plugin is not properly closed, reusing the shelf file results in an error:

DBPageNotFoundError: (-30986, 'BDB0075 DB_PAGE_NOTFOUND: Requested page not found')
NachoCP commented 8 years ago

I am having some problems when i am developing a plugin that extends from ShelfPlugin. The problem is the same that is described above. The first iteration loads everything successfully and creates the ".db" file. But when i am trying to access to the ".db" file, in the next iteration, it gives me the same error. The part of the code where i am loading the values into the ".db" file is described below:

    if 'classifier' not in self.sh:
        classifier = utilities.train(data,self.sh['classes'])
        self.sh['classifier'] = classifier
    self._classifier = self.sh['classifier']

I fixed it, everytime i use the plugin, i have to close it in order to free the deadlock of the ".db" file.

balkian commented 8 years ago

You need to deactivate the plugin, delete it, or close the shelf via the plugin's close method.