ThingWorx Extensibility > Extensions > Ghost Entities Extension
Ghost Entities Extension
* 
This extension can only be used with ThingWorx 8.5.x versions. This functionality is part of the ThingWorx platform in 9.0.0.
* 
The Ghost Entities extension is available on support.ptc.com under Download Software > Order or Download Software Updates > ThingWorx Foundation > Release 8.5 > ThingWorx Ghost Entities Extension > Most Recent Datecode .
About Ghost Entities
Ghost entities are in-memory representations of entities that failed to be created due to an error.
Ghost entities only persist until the next ThingWorx restart.
Failed entities are not committed to the database.
Generally, ghost entities are the result of improper exception handling in a service that calls a Create<Entity> service programmatically (CreateUser, CreateThing, etc).
If an exception is thrown during a custom ThingWorx service's execution, any entities that were created do not get committed to the database.
When a ghost entity exists, entities of the same type (Thing, User, Group, etc) and name cannot be created.
Ghost entities are not searchable using the spotlight search in Composer.
Ghost entities can only be found through the use of specific ThingWorx services.
Ghost entities cannot be interacted with via Composer, except through a few specific ThingWorx services.
Ghost Entities are removed from memory when ThingWorx is restarted.
For more information regarding how ghost entities can be created, along with best practices to prevent them, refer to Ghost Entities Example.
Using the Ghost Entities Extension
This extension creates a new resource instance named GhostEntitiesResource.
The new resource provides the GetGhostEntities service, which takes a single boolean parameter (deleteGhosts).
If the deleteGhosts parameter is false, the service will find and list ghost entities that currently reside in memory.
If the deleteGhosts parameter is true, the service will find and delete any ghost entities that currently reside in memory.
The infotable returned by GetGhostEntities(true) should be empty, indicating that all ghost entities were deleted.
Was this helpful?