I'm working on some Python scripts to automate the rebuilding of a couple of different network datasets based on new data coming in from our SDE. To ensure I wouldn't experience any SDE related issues (not really a database guy), I set up the network datasets in a FGDB. However, I'm experiencing some performance issues have decided to try to move the NDs to a feature dataset in SDE. This is where my issues have started coming up.
Since creating NDs isn't possible via ArcPy without getting into areas waaaay outside my skill level, I've got my scripts creating new edge and junction feature classes in memory, removing all rows in the participating ND feature classes, inserting the new features from memory into the empty participating feature classes, and rebuilding the existing ND. I created a new ND in our SDE, and attempted to run my first test, but hit issues when I began my update cursor to delete the participating features. Got the ol Workspace is Already in Transaction Mode error. I tried to register the feature dataset as versioned to see if that would help things, but since SDE NDs don't allow for versioning of feature classes that already participate in NDs, I couldn't. I'm at a loss here. Here's a code sample (sorry that it's an image, can't get code formatted to look right otherwise):
If there is a suggestion on how to get this code working OR another idea on how to handle regular updates of network datasets without manual creation of new NDs, please let me know. Any help is tremendously appreciated!!