eXtremeDB error code
来源:互联网 发布:mac版搜狗五笔造词 编辑:程序博客网 时间:2024/05/01 14:30
The following example demonstrates this procedure (note that this code is taken
from the 06_errorhandling_fatalerr sample):
static void errhandler( int n )
{
printf( "\n eXtremeDB runtime fatal error: %d", n );
getchar();
exit( -1 );
}
void main()
{
...
mco_error_set_handler( &errhandler );
...
rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);
if ( MCO_S_OK == rc ) {
printf("\n\n\tThe following attempt to create a new record\n"
"\tshould cause the Error handler to be called with Fatal\n"
"\tError 340049 because it requires a READ_WRITE transaction.\n"
"\tThe type of transaction started was MCO_READ_ONLY...\n"
"\tNote: you will get error code instead of fatal error if\n"
"\tthe program was linked not against _check runtime\n");
/* anObject_new() should fail with error code 340049 =
MCO_ERR_TRN+49 */
rc = anObject_new(t, &rec);
if ( MCO_S_OK == rc ) {
rc = anObject_data_put(&rec, data);
/* the following code will not be reached unless the
transaction is
changed to MCO_READ_WRITE */
if ( MCO_S_OK == rc ) {
rc = mco_trans_commit(t);
}
} else if (rc == MCO_E_ACCESS) {
printf("\nThe sample was linked with no-check runtime\n");
from the 06_errorhandling_fatalerr sample):
static void errhandler( int n )
{
printf( "\n eXtremeDB runtime fatal error: %d", n );
getchar();
exit( -1 );
}
void main()
{
...
mco_error_set_handler( &errhandler );
...
rc = mco_trans_start(db, MCO_READ_ONLY, MCO_TRANS_FOREGROUND, &t);
if ( MCO_S_OK == rc ) {
printf("\n\n\tThe following attempt to create a new record\n"
"\tshould cause the Error handler to be called with Fatal\n"
"\tError 340049 because it requires a READ_WRITE transaction.\n"
"\tThe type of transaction started was MCO_READ_ONLY...\n"
"\tNote: you will get error code instead of fatal error if\n"
"\tthe program was linked not against _check runtime\n");
/* anObject_new() should fail with error code 340049 =
MCO_ERR_TRN+49 */
rc = anObject_new(t, &rec);
if ( MCO_S_OK == rc ) {
rc = anObject_data_put(&rec, data);
/* the following code will not be reached unless the
transaction is
changed to MCO_READ_WRITE */
if ( MCO_S_OK == rc ) {
rc = mco_trans_commit(t);
}
} else if (rc == MCO_E_ACCESS) {
printf("\nThe sample was linked with no-check runtime\n");
rc = MCO_S_OK;
}
...
}
When the above code is executed it causes the error handler to be called with the
error code 340049 which generates the following output:
eXtremeDB runtime fatal error: 340049
Checking Appendix B, the error code value of 340000 corresponds to the constant
MCO_ERR_TRN. This indicates an error in the transaction being performed. (The
added value of 49 indicates the line within the runtime function where the
assertion failed, causing mco_stop() to be called. This is useful if it is necessary
to contact McObject support – or if the developer has a source code license. For a
more detailed explanation of error codes see Appendix B.)
- eXtremeDB error code
- eXtremeDB HA 306 312 error
- eXtremeDB -- the shared memory 80error
- eXtremeDB compiling error based on vxworks ppcgnu
- ERROR CODE
- ERROR CODE
- error code
- MQ ERROR CODE
- LDAP:error code 一览表
- MYSQL Error Code:150
- Http Error-Code List
- Error Code Description
- 2.4 Handling &Error Code
- Simple Error Code Generation
- winsock Error code
- Socket Error Code
- windows error code list
- Linux Error Code
- 获取最大值(经典!) --来自 蚊子的专栏
- 引用 jQuery
- 指针的故事一
- Perl笔记6
- 来广州传智播客学.Net, 给你真正的技术
- eXtremeDB error code
- 有23枚硬币在桌上,10枚正面朝上。蒙住你的眼睛,如何让左右两摞硬币正面朝上的一样多?
- html5 server-sent event 使用教程-翻译
- 数据集中参数的设置
- Javascript面向对象之构造函数模式
- Github-iOS备忘
- TryJquery- 14个jquery视频
- iOS6 UICollectionView(代码创建和nib)
- rsync 的核心算法