application 保存 object的问题

bluecobra 2008-11-27 04:10:33
一个数组,每个元素都是一个object对象(自己定义的类),将数组存放在application中,取回的时候,可以判断出数组application中相应的数组元素是object,但不能读取object的内容,这是什么原因?
...全文
55 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
smartcatiboy 2008-11-27
  • 打赏
  • 举报
回复
我再这问题上研究过很长的时间。

没有办法,除非你能用底层的语言编写跨线程的组件,还得服务商给你权限

不要跨页面使用object,即使是微软的dictionary,con,rst也不要用,自己class定义的更不可以。
bluecobra 2008-11-27
  • 打赏
  • 举报
回复
没有什么办法可以解决了?
smartcatiboy 2008-11-27
  • 打赏
  • 举报
回复
每隔asp是一个线程,线程间调用同一部件,必须是跨线程的组件

大部分的组件都是单线程组件,因而不能跨asp使用,即使能够使用也会发生不可预料的结果。


vb只能编写单线程组件,基于vb的脚本语言也是这样,vc通过特殊设置可以编写跨线程组件。


Automation Objects can have one of the following:

Single Only one client thread can be serviced at a time. COM serializes all incoming calls to enforce this. Your code needs no thread support.
Apartment Each object instantiated by a client is accessed by one thread at a time. You must protect against multiple threads accessing global memory, but objects can safely access their own instance data (object properties and members).
Free Each object instance may be called by multiple threads simultaneously. You must protect instance data as well as global memory.

Both This is the same as the Free-threaded model, except that all callbacks supplied by clients are guaranteed to execute in the same thread. This means you do not need protect values supplied as parameters to callback functions.
Neutral Multiple clients can call the object on different threads at the same time, but COM ensures that no two calls conflict. You must guard against thread conflicts involving global data and any instance data that is accessed by more than one method. This model should not be used with objects that have a user interface. This model is only available under COM+. Under COM, it is mapped to the Apartment model.

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧