Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a job (arcpy script) which relies on a query layer but it fails sometimes. It has to do with the query layer connection (the point where job fails randomly)- which is totally under the control of ORACLE team. I want to capture this to discuss with ORACLE team. What should be the right layer property to capture this?

share|improve this question
    
Did you try Layer.isBroken? –  Kirk Kuykendall Feb 5 '13 at 19:26
    
I am working on 10.0 –  Deep Feb 5 '13 at 20:11
    
Also, can I do anything about it? say add some wait time and try again (though users on the other side won't be happy with this- but waiting is better than breaking) –  Deep Feb 5 '13 at 20:25
add comment

1 Answer 1

I've run into some issues with a few different tools failing because of Oracle connection problems. The workaround has been to wrap whatever process is failing in a try...except block and call it again if needed.

def do_work(self, call_counter):
    if call_counter > 0:
        time.sleep(15)

    try:
        #do your query layer work here
        #return whatever results you need, if any
        return "it worked!"
    except:
        #log here if needed
        return ""

def __init__(self):
    work_output = ""
    call_counter = 0 

    while len(work_output) == 0:
        work_output = self.do_work(call_counter)
        call_counter += 1
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.