本文整理汇总了C++中Connection::Ref方法的典型用法代码示例。如果您正苦于以下问题:C++ Connection::Ref方法的具体用法?C++ Connection::Ref怎么用?C++ Connection::Ref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connection
的用法示例。
在下文中一共展示了Connection::Ref方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
uni::CallbackType Connection::Execute(const uni::FunctionCallbackInfo& args) {
UNI_SCOPE(scope);
Connection* connection = ObjectWrap::Unwrap<Connection>(args.This());
REQ_STRING_ARG(0, sql);
REQ_ARRAY_ARG(1, values);
REQ_FUN_ARG(2, callback);
String::Utf8Value sqlVal(sql);
ExecuteBaton* baton = new ExecuteBaton(connection, *sqlVal, &values, &callback);
if (baton->error) {
Local<String> message = String::New(baton->error->c_str());
delete baton;
UNI_THROW(Exception::Error(message));
}
uv_work_t* req = new uv_work_t();
req->data = baton;
uv_queue_work(uv_default_loop(), req, EIO_Execute, (uv_after_work_cb)EIO_AfterExecute);
connection->Ref();
UNI_RETURN(scope, args, Undefined());
}
示例2: sqlVal
Handle<Value> Connection::Execute(const Arguments& args) {
HandleScope scope;
Connection* connection = ObjectWrap::Unwrap<Connection>(args.This());
REQ_STRING_ARG(0, sql);
REQ_ARRAY_ARG(1, values);
REQ_FUN_ARG(2, callback);
String::AsciiValue sqlVal(sql);
ExecuteBaton* baton;
try {
baton = new ExecuteBaton(connection, *sqlVal, &values, &callback);
} catch(NodeOracleException &ex) {
return scope.Close(ThrowException(Exception::Error(String::New(ex.getMessage().c_str()))));
}
uv_work_t* req = new uv_work_t();
req->data = baton;
uv_queue_work(uv_default_loop(), req, EIO_Execute, (uv_after_work_cb)EIO_AfterExecute);
connection->Ref();
return scope.Close(Undefined());
}
示例3: sqlVal
Handle<Value> Connection::Execute(const Arguments& args) {
Connection* connection = ObjectWrap::Unwrap<Connection>(args.This());
REQ_STRING_ARG(0, sql);
REQ_ARRAY_ARG(1, values);
REQ_FUN_ARG(2, callback);
String::AsciiValue sqlVal(sql);
ExecuteBaton* baton;
try {
baton = new ExecuteBaton(connection, *sqlVal, &values, &callback);
} catch(NodeOracleException &ex) {
Handle<Value> argv[2];
argv[0] = Exception::Error(String::New(ex.getMessage().c_str()));
argv[1] = Undefined();
callback->Call(Context::GetCurrent()->Global(), 2, argv);
return Undefined();
}
uv_work_t* req = new uv_work_t();
req->data = baton;
uv_queue_work(uv_default_loop(), req, EIO_Execute, (uv_after_work_cb)EIO_AfterExecute);
connection->Ref();
return Undefined();
}
示例4: Rollback
uni::CallbackType Connection::Rollback(const uni::FunctionCallbackInfo& args) {
UNI_SCOPE(scope);
Connection* connection = ObjectWrap::Unwrap<Connection>(args.This());
REQ_FUN_ARG(0, callback);
RollbackBaton* baton = new RollbackBaton(connection, &callback);
uv_work_t* req = new uv_work_t();
req->data = baton;
uv_queue_work(uv_default_loop(), req, EIO_Rollback, (uv_after_work_cb)EIO_AfterRollback);
connection->Ref();
UNI_RETURN(scope, args, Undefined());
}
示例5: CommitBaton
Handle<Value> Connection::Commit(const Arguments& args) {
HandleScope scope;
Connection* connection = ObjectWrap::Unwrap<Connection>(args.This());
REQ_FUN_ARG(0, callback);
CommitBaton* baton;
try {
baton = new CommitBaton(connection, &callback);
} catch(NodeOracleException &ex) {
return scope.Close(ThrowException(Exception::Error(String::New(ex.getMessage().c_str()))));
}
uv_work_t* req = new uv_work_t();
req->data = baton;
uv_queue_work(uv_default_loop(), req, EIO_Commit, (uv_after_work_cb)EIO_AfterCommit);
connection->Ref();
return scope.Close(Undefined());
}
示例6: Undefined
Handle<Value> Connection::Commit(const Arguments& args) {
Connection* connection = ObjectWrap::Unwrap<Connection>(args.This());
REQ_FUN_ARG(0, callback);
CommitBaton* baton;
try {
baton = new CommitBaton(connection, &callback);
} catch(NodeOracleException &ex) {
Handle<Value> argv[2];
argv[0] = Exception::Error(String::New(ex.getMessage().c_str()));
argv[1] = Undefined();
callback->Call(Context::GetCurrent()->Global(), 2, argv);
return Undefined();
}
uv_work_t* req = new uv_work_t();
req->data = baton;
uv_queue_work(uv_default_loop(), req, EIO_Commit, (uv_after_work_cb)EIO_AfterCommit);
connection->Ref();
return Undefined();
}