def OCIHandleAlloc(environment, handle, handle_type, error_message):
    context_manager = ReplaceArgtypeByVoidPointerContextManager(oci.OCIHandleAlloc, 1)
    try:
        context_manager.__enter__()
        argtypes = oci.OCIHandleAlloc.argtypes
        status = oci.OCIHandleAlloc(environment.handle, byref(handle), handle_type, 0, argtypes[4]())
    finally:
        context_manager.__exit__()
        
    environment.check_for_error(status, error_message)
Esempio n. 2
0
def OCIHandleAlloc(environment, handle, handle_type, error_message):
    context_manager = ReplaceArgtypeByVoidPointerContextManager(
        oci.OCIHandleAlloc, 1)
    try:
        context_manager.__enter__()
        argtypes = oci.OCIHandleAlloc.argtypes
        status = oci.OCIHandleAlloc(environment.handle, byref(handle),
                                    handle_type, 0, argtypes[4]())
    finally:
        context_manager.__exit__()

    environment.check_for_error(status, error_message)
 def initialize(self, variable_type, var, cursor, oracle_descriptor_type, message):
     typed_data = variable_type.get_typed_data(var)
     
     context_manager = ReplaceArgtypeByVoidPointerContextManager(oci.OCIDescriptorAlloc, 1)
     
     try:
         context_manager.__enter__()
         arg4 = oci.OCIDescriptorAlloc.argtypes[4]()
         for i in xrange(var.allocelems):
             element = typed_data[i]
             status = oci.OCIDescriptorAlloc(var.environment.handle, byref(element), 
                                             oracle_descriptor_type, 0, arg4)
             var.environment.check_for_error(status, message)
     finally:
         context_manager.__exit__()