Using python for creating SDE versions seems very slow...

8448
10
04-16-2015 05:23 PM
WarrenDavison
Occasional Contributor

Hi There,

Hopefully someone can point me in the right direction with this, since I haven't been able to find the answer so far.

I have a python script that I run after the reconcile and post procedure to recreate the required child versions (simply for consistency and to save myself some time). However, it seems to take a really long time and the strange thing is that all of the versions take almost the exact same amount of time to create.

Would anyone be able to suggest what is at play here? Or provide an example of a similar script they may be using to do the same?

Here an sample from my script:

    import sde_generate_connect_strings


    sde_user_connect = sde_generate_connect_strings.generate_sde_user()

    # --------
    # create MAINTENANCE
    #
    print 'Create MAINTENANCE...'
    logfile.write('Create MAINTENANCE...\n')
    print 'Connection used is:  ' + sde_user_connect
    if sde_user_connect:
        try:
            arcpy.CreateVersion_management(sde_user_connect,'sde.DEFAULT', 'MAINTENANCE', 'PUBLIC')
            print arcpy.GetMessages()
            logfile.write(arcpy.GetMessages())
        except:
            print 'Oops!  Exception...'
            print arcpy.GetMessages()
            logfile.write(arcpy.GetMessages())
    else:
        print '* * * * * * * *'
        print 'Database connection doesn\'t exist - failed to create MAINTENANCE'
        print '* * * * * * * *'

Thanks,

Warren

0 Kudos
10 Replies
by Anonymous User
Not applicable

I'm glad I read this thread to the end!  Using arcpy.SetLogHistory(False) solved my issue with python taking so long to create and delete versions.  Thanks!

0 Kudos