Esempio n. 1
0
static VALUE blocking_function_ensure(oci8_svcctx_t *svcctx)
{
    if (!NIL_P(svcctx->executing_thread)) {
        /* The thread is killed. */
        OCIBreak(svcctx->base.hp.ptr, oci8_errhp);
        OCIReset(svcctx->base.hp.ptr, oci8_errhp);
        svcctx->executing_thread = Qnil;
    }
    return Qnil;
}
Esempio n. 2
0
VALUE oci8_break(VALUE self)
{
    oci8_handle_t *h;
    sword rv;

    Get_Handle(self, h); /* 0 */
    rv = OCIBreak(h->hp, h->errhp);
    if (rv != OCI_SUCCESS)
        oci8_raise(h->errhp, rv, NULL);
    return self;
}
Esempio n. 3
0
/*
 * call-seq:
 *   break
 *
 * Cancels the executing SQL.
 *
 * See also #non_blocking=.
 */
static VALUE oci8_break(VALUE self)
{
    oci8_svcctx_t *svcctx = DATA_PTR(self);

    if (NIL_P(svcctx->executing_thread)) {
        return Qfalse;
    }
#ifndef HAVE_RB_THREAD_BLOCKING_REGION
    chker2(OCIBreak(svcctx->base.hp.ptr, oci8_errhp), &svcctx->base);
#endif
    rb_thread_wakeup(svcctx->executing_thread);
    return Qtrue;
}
Esempio n. 4
0
/*
 * call-seq:
 *   break
 *
 * Cancels the executing SQL.
 *
 * See also #non_blocking=.
 */
static VALUE oci8_break(VALUE self)
{
    oci8_svcctx_t *svcctx = DATA_PTR(self);
#ifndef HAVE_RB_THREAD_BLOCKING_REGION
    sword rv;
#endif

    if (NIL_P(svcctx->executing_thread)) {
        return Qfalse;
    }
#ifndef HAVE_RB_THREAD_BLOCKING_REGION
    rv = OCIBreak(svcctx->base.hp.ptr, oci8_errhp);
    if (rv != OCI_SUCCESS)
        oci8_raise(oci8_errhp, rv, NULL);
#endif
    rb_thread_wakeup(svcctx->executing_thread);
    return Qtrue;
}
Esempio n. 5
0
GSQLCursorState 
oracle_cursor_stop (GSQLCursor *cursor)
{
	GSQL_TRACE_FUNC;
	
	GSQLSession *session;
	GSQLEOracleSession *spec_session;
	GSQLEOracleCursor *spec_cursor;
	
	g_return_val_if_fail (GSQL_IS_CURSOR (cursor), GSQL_CURSOR_STATE_ERROR);
	
	session = cursor->session;
	spec_session = session->spec;
	spec_cursor = cursor->spec;
	
	OCIBreak (spec_session->svchp, spec_cursor->errhp);
	OCIReset (spec_session->svchp, spec_cursor->errhp);
	
	return GSQL_CURSOR_STATE_STOP;
	
}
Esempio n. 6
0
File: asynch.c Progetto: ryzhov/ATS0
/*
 * close current timelimited operation and disconnect if timeout occured
 * return true only if work in asynch mode and timeout detect
 */
int done_timelimit(ora_con_t* con, sword status)
{
    int ret = 0;

    if (!cur_asynch_mode)
        return 0;

    if (remap_status(con, status) == OCI_STILL_EXECUTING) {
        sword code;

        status = OCIBreak(con->svchp, con->errhp);
        if (status != OCI_SUCCESS)
            LM_ERR("driver: %s\n",
                   db_oracle_error(con, status));

        status = OCIReset(con->svchp, con->errhp);
        if (   status == OCI_ERROR
                && OCIErrorGet(con->errhp, 1, NULL, &code,
                               NULL, 0, OCI_HTYPE_ERROR) == OCI_SUCCESS
                && code == 1013)
        {
            status = OCI_SUCCESS;
        }
        if (status != OCI_SUCCESS)
            LM_ERR("driver: %s\n",
                   db_oracle_error(con, status));
        db_oracle_disconnect(con);
        ++ret;
    } else {
        status = change_mode(con);
        if (status != OCI_SUCCESS) {
            LM_ERR("driver: %s\n", db_oracle_error(con, status));
            ++ret;
        } else {
            cur_asynch_mode = 0;
        }
    }
    return ret;
}
Esempio n. 7
0
static void oci8_unblock_func(void *user_data)
{
    oci8_svcctx_t *svcctx = (oci8_svcctx_t *)user_data;
    OCIBreak(svcctx->base.hp.ptr, oci8_errhp);
}