Is the tree name part of the DN max length (256 chars)?

Have a client with eDirectory, trying to create an object whose
DN in LDAP format is 246 characters.

But we get -610 illegal DS name and -353 dn to long.

If we shorten the leaf object CN by two characters from 40 to 38 it gets

The tree name has 8 characters.

But even then we are at 254 characters unless we add backslash to the
tree name: \TREE_NAME\O=XXXX\...

Then we are at exactly 256 characters...

Anybody knows how the DN length is calculated?