当前位置: 首页>>代码示例>>C++>>正文


C++ Connection::Ref方法代码示例

本文整理汇总了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());
}
开发者ID:BCool13,项目名称:node-oracle,代码行数:25,代码来源:connection.cpp

示例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());
}
开发者ID:ChaosPower,项目名称:sails-oracle,代码行数:25,代码来源:connection.cpp

示例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();
}
开发者ID:NCJ1979,项目名称:NodeJS,代码行数:28,代码来源:connection.cpp

示例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());
}
开发者ID:BCool13,项目名称:node-oracle,代码行数:16,代码来源:connection.cpp

示例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());
}
开发者ID:ChaosPower,项目名称:sails-oracle,代码行数:21,代码来源:connection.cpp

示例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();
}
开发者ID:NCJ1979,项目名称:NodeJS,代码行数:24,代码来源:connection.cpp


注:本文中的Connection::Ref方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。