I restarted the ArcGIS Server machine without any positive results.
In the geoprocessing which is a python script, I create update and search cursors on data participating in the network dataset. Then I delete those cursors. After that, I perform an integrate operation on the features participating in the network dataset and finally, I build the network.
I don't see where a lock could have been placed, besides the one created by the cursors (that I delete after using).
When I try to manually build the NA dataset (after stopping the services) I get an error : building network dataset failed. Without any further explanation!
NB: the network analysis dataset is stored in a file geodatabase.