- 论坛徽章:
- 15
|
本帖最后由 yulihua49 于 2013-11-27 11:21 编辑
boyatchinaunix 发表于 2013-11-27 10:57 ![]()
这个功能正是我想要的,谢谢啊。
/**
* Set OCI blocking mode on/off.
*
* By default a database connection is in blocking mode. This means
* the call does not return until the task is finished. With this
* function you can change to non-blocking mode.
* In this case some functions can return SQLO_STILL_EXECUTING.
*
* The functions are:
* <ul>
* <li>sqlo_open2 (when called for queries)
* <li>sqlo_reopen (when called for queries)
* <li>sqlo_fetch (when called for non-queries)
* <li>sqlo_exec
* <li>sqlo_execute
* </ul>
* @param dbh I - A database handle where the blocking should be changed.
* @param on I - SQLO_ON switches blocking mode on, SQLO_OFF switches to
* non-blocking mode
* @return <ul>
* <li>SQLO_SUCCESS
* <li>SQLO_INVALID_DB_HANDLE
* <li> < 0 on error
* </ul>
* @since Version 2.2
*/- if ( blocking != new_mode)
- {
- /* toggle the mode */
- if (OCI_SUCCESS !=
- (dbp->status = OCIAttrSet( (dvoid *) dbp->srvhp,
- (ub4) OCI_HTYPE_SERVER,
- (dvoid *) 0,
- (ub4) 0,
- (ub4) OCI_ATTR_NONBLOCKING_MODE,
- dbp->errhp))) {
- TRACE(2, fprintf(_get_trace_fp(dbp), "Unable to toggle blocking mode"););
- CHECK_OCI_STATUS_RETURN(dbp, dbp->status, "sqlo_set_blocking", "");
- return (dbp->status);
- }
- }
复制代码 |
|