#1115 documentNumber limited to 2^32

Michael Kay
Internals (8)
Michael Kay

Saxon allocates a unique number to each document/tree that is constructed. This number is limited to a 32-bit integer. In a busy system it is possible for this limit to be exceeded after a few months' continuous running. The consequences of the number overflowing are somewhat unpredictable (and difficult to test!), but may include incorrect results for operations that depend on node identity.

Saxon 9.2 and 9.3 already include changes that anticipate this number increasing to a 64 bit integer, however the changes were not implemented right through the system; the main effect of the patch is to change the DocumentNumberAllocator to allocate a long integer. The problem is also being patched for Saxon 9.1 where the changes required are rather more extensive, and include a change to the NodeInfo interface so that the getDocumentNumber() method returns a long rather than an int; this could affect any existing code written by users or third parties that implements the NodeInfo interface, for example an adapter or wrapper for some external data model.


  • Michael Kay
    Michael Kay

    Fixed in