上传+ Castleproject Monorail:上传时无法进行 Ajax 调用

发布于 2024-08-15 04:08:31 字数 407 浏览 4 评论 0原文

我正在开发一个使用 uploadify jquery 插件和 CastleProject Monorail 作为后端的项目。我遇到的问题是,在上传时,它似乎阻止了 ajax 调用(同时调用)。上传完成后调用ajax。

奇怪的是,当我在一个新的 castleproject 单轨铁路项目中实现 uploadify 时,同时调用的 ajax 调用确实有效。

在前一个项目中似乎有一些我目前无法想到的设置导致了阻塞。 Web.config 设置相同。

有人知道这可能是什么原因吗?

谢谢

更新:

我想我发现了问题:一旦使用Session对象,网络服务器就会阻止多个请求。这是为了规避更普遍的竞争条件问题。

有什么方法可以禁用此功能,以便我可以自己处理竞争条件?

I am working on a project using the uploadify jquery plugin and CastleProject Monorail as backend. The problem I get is that while uploading it seems to block the ajax calls (which are called in the meantime). The ajax are called after the upload is finished.

The strange thing is, when I implement uploadify in a new castleproject monorail project, ajax calls that are called in the meantime DO work.

There seems to be some setting which I cannot think of at the moment in the former project that causes the blocking. Web.config settings are the same.

Does anybody have an idea what can be the cause of this?

Thanks

Update:

I think I found the problem: As soon as the Session object has been used, the webserver blocks multiple requests. This to circumvent the more general problem of race conditions.

Is there some way to disable this so I can handle the race conditions myself?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲世九天 2024-08-22 04:08:31

找到了解决方案/解决方法,但它可能不适用于所有情况。感谢 Mauricio Scheffer 的指点。

不要使用单轨处理程序(即控制器函数)来处理上传(或长时间运行的过程),而是在单轨之外创建一个单独的处理程序(ashx)来完成您的工作。

该处理程序应实现 IReadOnlySessionState 接口,以便它不会阻止多个请求。唯一的问题是,在此处理程序中,您只能读取会话对象,而不能写入它。

Found a solution / workaround, but it may not be applicable to every case. Thanks Mauricio Scheffer for giving directions.

Instead of using a monorail handler (i.e. a controller function) to handle the upload (or long running process), create a separate handler (ashx) outside of monorail to do your stuff.

This handler should implement the IReadOnlySessionState interface, so that it won't block multiple requests. The only catch is that in this handler you only may read from the session object and not to write to it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文