I have already implement auto number with plugin, and it is through another entity type to ensure all operations are in one transaction. but I have another question, that is can we use process lock(eg. mutex) to fix it? this will more flexible than before, isn't it?
Plugin's can be run on multiple machines concurrently depending on your installation - that's why the entity (database) lock is regularly used.