datajoint/datajoint-matlab

Drop table does not successfully complete due to one of the packages being inaccessible

Opened this issue · 1 comments

For the case where a user is using a single DataJoint connection to work on 2 different projects (meaning there are packages containing definitions only accessible within the project directory), if they create/initialize a schema under one project and then switches to another to later trigger a drop within the current project, the following error is displayed:

image

The issue comes from here. Because a single connection was used on 2 different projects (that may not be added to path), both packages are 'registered' for the connection. This means when the reload is triggered (like on a table drop), it tries to getSchema for each package where one is now inaccessible which results in the above failure.

Is there a reason why we force this reload? Can we perhaps note on the schema that it should be updated and invoke it on next access? Curious overall at the intent behind how this solution.

This could be a corner case but I'm not entirely positive. 'Feels' like using a DataJoint as a MATLAB utility to connect and work with several projects in a given session might be fairly common. 🤷‍♂️

Solution for now will be to catch and warn user when package is inaccessible.