Skip to content

Reclaiming lost object IDs

Vjekoslav Babić edited this page Apr 14, 2023 · 3 revisions

Reclaim Object ID Feature in AL Object ID Ninja

In software development using the AL language, object IDs are used to uniquely identify objects within an application. However, sometimes developers assign object IDs to objects that are later deleted or removed from the codebase. These assigned but unused object IDs are called "lost object IDs". Lost object IDs take up space in the available ID pool and can cause confusion when assigning new IDs.

Purpose of the Feature

The Reclaim object ID feature in AL Object ID Ninja allows developers to release lost object IDs and free them up for assignment again. By doing so, it ensures that the available ID pool is as accurate and complete as possible, reducing the risk of ID collisions.

Dangers of Reclaiming Object IDs

It is important to note that not all "lost" object IDs can be reclaimed.

Work in another branch (by another developer)

It is possible that one developer may see an object ID as "lost", while in fact it has been assigned by another developer in their local branch and has not yet been pushed and integrated into the mainline. In such cases, developers need to first check that the ID is not in use by any local or remote branches before reclaiming it. Reclaiming an ID that is already in use can cause conflicts and errors during merge.

App pools

App pools share the same object ID ranges, however each app only "sees" objects present in that app. When one app consumes an ID from the common range, other apps in the pool will see this object as "lost". When you are working in an app pool, you may still reclaim object IDs, however you need to be extra careful not to cause build conflicts, or - more likely - deployment conflict.

Conclusion

Using the "Reclaim object ID" feature is an essential part of managing object IDs effectively. By reclaiming lost IDs that are not in use, developers can reduce the risk of ID collisions and improve the overall efficiency of their development process. However, it is crucial to ensure that an ID is truly lost before reclaiming it to avoid conflicts and errors during merge.