【转帖】 Tuxedo client 原理_MQ, Tuxedo及OLTP讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MQ, Tuxedo及OLTP讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 5287 | 回复: 0   主题: 【转帖】 Tuxedo client 原理        下一篇 
众里寻他
注册用户
等级:少尉
经验:383
发帖:27
精华:1
注册:2013-2-25
状态:离线
发送短消息息给众里寻他 加好友    发送短消息息给众里寻他 发消息
发表于: IP:您无权察看 2013-3-4 11:38:36 | [全部帖] [楼主帖] 楼主

(联动北方技术论坛 - Powered by Landingbj) [网际游航]ATMI:Application-to-Transaction Monitor Interface。
(联动北方技术论坛 - Powered by Landingbj) [网际游航]1.tpchkauth
(联动北方技术论坛 - Powered by Landingbj) [网际游航]int tpchkauth();
(联动北方技术论坛 - Powered by Landingbj) [网际游航]

在调用tpinit()之前检查是否需要认证和认证的级别。

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

返回值:

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

TPNOAUTH:不需要认证;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

TPSYSAUTH:系统认证,需要密码;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

TPAPPAUTH:应用认证,需要密码和特殊应用数据;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

当返回值为TPSYSAUTH和TPAPPAUTH时,我们必须使用tpalloc()分配一个TPINIT结构,在该结构中填入认证数据,然后用该结构作为参数调用tpinit()。

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

失败原因主要有:

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

协议错;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

操作系统错;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]tuxedo底层错。
(联动北方技术论坛 - Powered by Landingbj) [网际游航]2.tpinit
(联动北方技术论坛 - Powered by Landingbj) [网际游航]

在使用tuxedo其他服务之前,必须调用tpinit加入到应用中。

(联动北方技术论坛 - Powered by Landingbj) [网际游航]int tpinit(TPINIT *tpinfo);
(联动北方技术论坛 - Powered by Landingbj) [网际游航]

参数说明:

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

tpinfo:指向TPINIT类型的指针。

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

TPINIT类型在atmi.h中有定义,如以下几个域:

(联动北方技术论坛 - Powered by Landingbj) [网际游航] char usrname [32]; (32 characters significant)
(联动北方技术论坛 - Powered by Landingbj) [网际游航] char cltname [32]; (32 characters significant)
(联动北方技术论坛 - Powered by Landingbj) [网际游航] char passwd [32]; (8 characters significant)
(联动北方技术论坛 - Powered by Landingbj) [网际游航] char grpname [32]; (32 characters significant)
(联动北方技术论坛 - Powered by Landingbj) [网际游航] long flags;
(联动北方技术论坛 - Powered by Landingbj) [网际游航] long datalen;
(联动北方技术论坛 - Powered by Landingbj) [网际游航] long data;
(联动北方技术论坛 - Powered by Landingbj) [网际游航]

usrname:用户名或login名;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

cltname:应用定义;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

passwd:应用密码;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

grpname:在事务中使用,必须在配置文件定义的组列表中;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

flags:定义请求/通知类型和系统存取方法,其中TPU_SIG、TPU_DIP和TPU_IGN不能同时指定;TPSA_FASTPATH和TPSA_PROTECTED不能同时指定。有如下的值:

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

TPU_SIG:选择信号通知;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

TPU_DIP:选择dip-in通知;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

TPU_IGN:忽略通知;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

TPSA_FASTPATH:选择fastpath方式系统存取;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

TPSA_PROTECTED:选择protected方式系统存取;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

datalen:应用特殊数据的长度;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

data:应用特殊数据;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

域flags���值覆盖���统的缺省定义,前提是在配置文件中没有指定NO_OVERRIDE。

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

如果参数使用(TPINIT*)NULL,则client使用系统缺省的通知设置和系统存取设置,若需要认证,则出错返回TPEPERM。

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

tpinit()调用失败返回-1,失败原因有:

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

参数错;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

没有空间在BB;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

没有权限;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

协议错;

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

操作系统错;

(联动北方技术论坛 - Powered by Landingbj) [网际游��]

tuxedo底层错。

(联动北方技术论坛 - Powered by Landingbj) [网际游航]

示例:

(联动北方技术论坛 - Powered by Landingbj) [网际游航]TPINIT *tpinfo;
(联动北方技术论坛 - Powered by Landingbj) [网际游航]char password[9];
(联动北方技术论坛 - Powered by Landingbj) [网际游航]
(联动北方技术论坛 - Powered by Landingbj) [网际游航]if ((tpinfo = (TPINIT *)tpalloc(“TPINIT”, NULL,
(联动北方技术论坛 - Powered by Landingbj) [网际游航]TPINITNEED(0))) == NULL) {
(联动北方技术论坛 - Powered by Landingbj) [网际游航] (void)userlog(“unable to allocate TPINIT buffer”);
(联动北方技术论坛 - Powered by Landingbj) [网际游航] exit(1);
(联动��方技术论坛 - Powered by Landingbj) [网际游航]}
(联动北方技术论坛 - Powered by Landingbj) [网际游航](void)strcpy(tpinfo->passwd, password);
(联动北方技术论坛 - Powered by Landingbj) [网际游航](void)strcpy(tpinfo->usrname, “Smith”);
(联动北方技术论坛 - Powered by Landingbj) [网际游航](void)strcpy(tpinfo->cltname, “Teller”);
(联动北方技术论坛 - Powered by Landingbj) [网际游航]tpinfo->flags = (TPU_DIP|TPSA_PROTECTED);
(联动北方技术论坛 - Powered by Landingbj) [网际游航]if (tpinit(tpinfo) == -1) {
(联动北方技术论坛 - Powered by Landingbj) [网际游航] (void)userlog(“failed to join application”);
(联动北方技术论坛 - Powered by Landingbj) [网际游航] tpfree((char*)tpinfo);
(联动北方技术论坛 - Powered by Landingbj) [网际游航] exit(1);
(联动北方技术论坛 - Powered by Landingbj) [网际游航]}
(联动北方技术论坛 - Powered by Landingbj) [网际游航]



赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论