Invisible object

Hi!

Sometimes we got the problem. 

We have a vault applications that can create new objects. They are creating by "M-Files Server" user. But because of some errors during the creation object can stay created but not checked in. In this case this object is invisible for every user, even for vault admin. It can not be found by ID or some metadata.The only one place where I can see it is M-Files Admin (right click on object - Content):

But I can not for example delete it from there. I can not enter to M-Files Desktop as M-Files Server user for delete it manually, I can not find it as another user and I can not delete it in M-Files Admin. The only one way is delete it in script using its ID. But It is very bad solution. Is there any another way to do this?

Thank you!

BR, Aleks.

Parents
  • This happens when code creates objects but they do not get checked in (e.g. an exception is thrown when the check-in method is called) . This shouldn't happen with the transactional vault reference, but can happen with non-transactional references.

    You need to check why this is happening and ensure that you trap exceptions and undo the checkout, and ensure that you're using the transactional vault reference wherever possible. 

  • I understand this, and you are certainly right, this is a problem of code and it should be prevented by algorithm.

    But just for cases of such objects created in the process of debugging or some errors in code - is this possible to find and delete or check in these objects manually?

    The only way I found is to check if there are some "missing" objectIDs in the serial list of objects, find them in the "Content" list of object in M-Files Admin and delete/checkin them using the code in separate script.

    Is there any way for, lets say, find in Desktop app all checked-out objects created by "M-Files server" user and delete them (probably for this it is neccesary toset some additional permissions for user )? Or may be it is possible to log in to Desktop app as "M-Files server" user?

  • This is a problem of how the code has been implemented, yes.

    These objects are only visible to the user that started the creation process, using the machine that the process was started on.  If these were caused by bad server-side script (e.g. your VAF code didn't correctly use the transactional vault reference) then the only thing that can fix them is also server-side code.

    You need to get to the root cause of *why* these happened and ensure that the code there is using a pattern that ensures that this does not occur again.  Once you have done that I think the only real approach is to write some server-side code (VAF/VBScript) that finds "all objects checked out to me" and undoes the checkout.

Reply
  • This is a problem of how the code has been implemented, yes.

    These objects are only visible to the user that started the creation process, using the machine that the process was started on.  If these were caused by bad server-side script (e.g. your VAF code didn't correctly use the transactional vault reference) then the only thing that can fix them is also server-side code.

    You need to get to the root cause of *why* these happened and ensure that the code there is using a pattern that ensures that this does not occur again.  Once you have done that I think the only real approach is to write some server-side code (VAF/VBScript) that finds "all objects checked out to me" and undoes the checkout.

Children