Пример #1
0
int xa_open    (char * xa_info, int rmid, long flags)
{   int rc;
    char new_xa_info[512];

    ReformatOpenString(xa_info, new_xa_info, TRUE);
       /* convert ODBC DSN and info to Ingres format XA OpenString */
    
    Prologue("xa_open");  /* single thread LIBQXA  and set error handler */     
    ReformatOpenString(xa_info, errlog_xa_info, FALSE);  /* xa_info w/o passwords*/
    rc=piixa_switch->xa_open_entry(new_xa_info, rmid, flags);
    Epilogue();
    return(rc);


//    char s[512];
//    memset(s,'\0',sizeof(s));
//    wsprintf(s,"rmid=0x%8.8x   flags=0x%8.8x\n",(long)rmid, flags);
//    strcpy(s,"xa_info=");
//    if (xa_info)
//       strncat(s,xa_info,sizeof(s)-10);
//    else 
//       strcat(s,"<null>");
//    MessageBox(NULL, s, "xa_open", MB_ICONINFORMATION|MB_OK);
//    return XA_OK;
}
Пример #2
0
void FiniSubProg( void )
{
    FrlFini( &ITPool );
    CheckCSList( CS_EMPTY_LIST ); // all control structures should be finished
    if( !Remember.endstmt ) {
        Error( EN_NO_END );
    }
    if( ( SgmtSw & SG_SYMTAB_RESOLVED ) == 0 ) {
        STResolve();
        SgmtSw |= SG_SYMTAB_RESOLVED;
    }
    if(( ProgSw & PS_BLOCK_DATA ) != 0 ) {
        GEndBlockData();
    } else if(( ProgSw & PS_IN_SUBPROGRAM ) != 0 ) {
        Epilogue();
    } else if( ( ProgSw & PS_ERROR ) == 0 ) {
        GReturn();
    }
    DumpEntries();
    BIResolveUndefTypes();
    STDump();
    TDSubFini();
    BIEndSubProg();
    EnPurge(); // Must come after TDSubFini() for optimizing compiler
    SubProgId = NULL;
}
void CRULogCleanupTaskExecutor::Work()
{
	switch(GetState())
	{
		case EX_START:
			{
				RUASSERT(FALSE == IsTransactionOpen());
				Start();
				break;
			}

		case EX_CLEAN:
			{
				RUASSERT(FALSE == IsTransactionOpen());
				Clean();
				break;
			}
		case EX_EPILOGUE:
			{
				RUASSERT(FALSE == IsTransactionOpen());
				Epilogue();
				break;
			}
		default: RUASSERT(FALSE);
	}
}
Пример #4
0
int xa_complete(int * handle, int * retval, int rmid, long flags)
{   int rc;

    Prologue("xa_complete");  /* single thread LIBQXA  and set error handler */     
    rc=piixa_switch->xa_complete_entry(handle, retval, rmid, flags);
    Epilogue();
    return(rc);
}
Пример #5
0
int xa_forget  (XID * xid, int rmid, long flags)
{   int rc;

    Prologue("xa_forget");  /* single thread LIBQXA  and set error handler */     
    rc=piixa_switch->xa_forget_entry(xid, rmid, flags);
    Epilogue();
    return(rc);
}
Пример #6
0
int xa_recover (XID * xids, long count, int rmid, long flags)
{   int rc;

    Prologue("xa_recover");  /* single thread LIBQXA  and set error handler */     
    rc=piixa_switch->xa_recover_entry(xids, count, rmid, flags);
    Epilogue();
    return(rc);
}
Пример #7
0
int xa_close   (char * xa_info, int rmid, long flags)
{   int rc;

    Prologue("xa_close");  /* single thread LIBQXA  and set error handler */     
    rc=piixa_switch->xa_close_entry(xa_info, rmid, flags);
    Epilogue();
    return(rc);

}
void CRUUnAuditRefreshTaskExecutor::Work()
{
	switch (GetState())
	{
	case EX_START: // MAIN PROCESS
		{
			RUASSERT(FALSE == IsTransactionOpen());
			Start();
			break;
		}
	case EX_PROLOGUE: // MAIN PROCESS
		{
			RUASSERT(FALSE == IsTransactionOpen());
			// Turn the MV (+ optionally its indexes) non-available
			Prologue();
			break;
		}
	case EX_PURGE_DATA: // MAIN PROCESS
		{
			RUASSERT(FALSE == IsTransactionOpen());
			// Execute purgedata from the MV (with indexes)
			PurgeData();			
			break;
		}
	case EX_REFRESH: // REMOTE PROCESS
		{
			RUASSERT(FALSE == IsTransactionOpen());
			// Execute the incremental INTERNAL REFRESH
			Refresh();
			break;
		}
	case EX_RECOMPUTE: // REMOTE PROCESS
		{
			// Execute INTERNAL REFRESH RECOMPUTE
			Recompute();
			break;
		}
	case EX_POPINDEX:	// REMOTE PROCESS
		{
			RUASSERT(FALSE == IsTransactionOpen());
			PopulateIndexes();
			break;
		}
	case EX_EPILOGUE:	// MAIN PROCESS
		{
			RUASSERT(FALSE == IsTransactionOpen());
			// Turn the MV (+ optionally indexes) back to available
			// Perform the final metadata update
			Epilogue();
			break;
		}
	default: RUASSERT(FALSE);
	}
}
void CRUTableSyncTaskExecutor::Work()
{
	switch (GetState())
	{
	case EX_INC_EPOCH: // REMOTE PROCESS
		{
			IncEpoch();
			break;
		}
	case EX_EPILOGUE: // MAIN PROCESS
		{
			Epilogue();
			break;
		}
	default: RUASSERT(FALSE);
	}
}
Пример #10
0
void Plugin::ExecuteFunction(ExecuteStruct& es, const std::function<void()>& f)
{
	Prologue();
	++Activity;
	try
	{
		f();
	}
	catch (SException &e)
	{
		if (ProcessSEHException(this, m_model->GetExportName(es.id), e.GetInfo()))
		{
			m_model->GetOwner()->UnloadPlugin(this, es.id);
			es.Result = es.Default;
			Global->ProcessException=FALSE;
		}
		else
		{
			throw;
		}
	}
	catch (std::exception &e)
	{
		if (ProcessStdException(e, this, m_model->GetExportName(es.id)))
		{
			m_model->GetOwner()->UnloadPlugin(this, es.id);
			es.Result = es.Default;
			Global->ProcessException = FALSE;
		}
		else
		{
			throw;
		}
	}
	--Activity;
	Epilogue();
}
void CRUAuditRefreshTaskExecutor::Work()
{
	switch (GetState())
	{
	case EX_START: // MAIN PROCESS
		{
			// This state only logs the opening message
			Start();
			break;
		}	
	case EX_PROLOGUE: // MAIN PROCESS
		{
			// This state just starts a transaction  
			Prologue();
			break;
		}
	case EX_PURGE_DATA: // MAIN PROCESS
		{
			RUASSERT(FALSE == IsTransactionOpen());
			// Execute purgedata from the MV (with indexes)
			PurgeData();			
			break;
		}
        case EX_REMOTE_START:
                {
                        // this state starts up the table lock protocol
                        // and starts a transaction                 
                        RemoteStart();
                        break;
                }
	case EX_RECOMPUTE: // REMOTE PROCESS
		{
			// This state execute an internal refresh recompute statement 
			Recompute();
			break;
		}
	case EX_REFRESH: // REMOTE PROCESS
		{
			// This state execute an internal refresh statement 
			// It may be a multi delta refresh or a single delta refresh
			Refresh();
			break;
		}
        case EX_POPINDEX:	// REMOTE PROCESS
		{
			RUASSERT(FALSE == IsTransactionOpen());
			PopulateIndexes();
			break;
		}        
	case EX_REMOTE_END: // REMOTE PROCESS
		{
			RemoteEnd();
			break;
		}
	case EX_EPILOGUE: // MAIN PROCESS
		{
			// Update all meta-data concerning the mv and used tables objects
			Epilogue();
			break;
		}
	default: RUASSERT(FALSE);
	}
}
Пример #12
0
int main()
{
    SStreamStdin s_in;
    IntelibReader reader;

    headerlist = (L|
        "sexpress/sexpress.hpp",
        "sexpress/iexcept.hpp",
        "scheme/scheme.hpp",
        "scheme/schsymb.hpp",
        "scheme/schfun.hpp",
        "scheme/schpack.hpp");

    funclist = *PTheEmptyList;

    do {
        SReference r;
        try {
            r = reader.Read(s_in);
        }
        catch(const IntelibX_reader_error &err) {
            fprintf(stderr, "reader: %s %s line %d\n", 
                             err.Description(),
                             err.Parameter()->TextRepresentation().c_str(),
                             err.Line()
            );
            return 1;
        }
        if(r==IntelibReader::EofMarker) {
            break;
        }

        SExpressionCons *c = r.SimpleCastGetPtr<SExpressionCons>();
        if(!c) continue;

        if(c->Car().IsEql(directives)) {
            for(SReference i=r.Cdr(); !i.IsEmptyList(); i=i.Cdr()) {
                ProcessDirective(i.Car());        
            }
        } else {
            ProcessDirective(r);        
        }
    } while(true);

    try {
        Preamble(headerlist);
        Funclist(funclist);
        Listbegin();
        List(funclist);
        Epilogue();
    }
    catch(const IntelibX& ex) {
        fprintf(stderr, "Exception [%s] (%s) caught "
            "during execution of the file\n",
            ex.Description(),
            ex.Parameter().GetPtr() ? 
                ex.Parameter()->TextRepresentation().c_str() : "");
        #if 0
        if(ex.Stack().GetPtr()) {
            fprintf(stderr, "%s",
                stack_representation(ex.Stack()).c_str());
        }
        #endif
        return 1;
    }

    return 0;
}