在WCF中访问服务层中的会话 [英] Accesssing Session in Service Layer in WCF

查看:121
本文介绍了在WCF中访问服务层中的会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下函数CreateAudiTrail(AuditTrail ATObj).
在此函数中,我先调用Create sp,然后调用Update sp.
我想跟踪(不使用触发器)对这些sps的调用.
我将启动一个线程threadCreate来执行Create Sp.一个创建结束了,我想检查threadCreate是否仍处于活动状态,然后执行Update sp.

如何在WCF体系结构的服务层中访问会话(或类似内容),即如何在执行Update sp时检查threadCreate是否仍然存在?

I have a the following function CreateAudiTrail (AuditTrail ATObj).
In this function I call first the Create sp and then the Update sp.
I want to track (without using triggers) the call made to these sps.
I will start a thread, threadCreate for the execution of Create Sp. One create is over, I want to check whether the threadCreate is still active and then execute the Update sp.

How do I access a session (or something similar) in the service layer of WCF architecture i.e. how can I check whether the threadCreate still exists when Update sp is executed?

It would great if anyone could give me a lead to the solution!

推荐答案

嗨..
只需在WCF中签出InstanceMAnagement.
wcf中的实例管理权限/会话
Hi..
Just check out for InstanceMAnagement in WCF.
instancemanagement-persession in wcf


我不确定我是否很好地了解了您,但这是我的建议:
您要等到线程完成为止;对?如果是这样,请调用threadCreate.Join().该调用将阻塞直到线程完成.
我想您这里不需要像会话这样的问题,而且问题比WCF(?)更与线程相关(?)
顺便说一句,您没有提到为什么决定为此创建线程.
祝你好运:)
I am not sure if I have understood you well, but here is my suggestion:
You want to wait till the thread is done; right? If so call threadCreate.Join(). This call will block till the thread is done.
I guess that you don''t need something like a session here and the problem is more related to threading than WCF(?)
BTW you didn''t mention why you decided to create a thread for this.
Good luck :)


这篇关于在WCF中访问服务层中的会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆