当传统的ASP不打烊的记录,会发生什么? [英] What happens when NOT closing recordsets in classic asp?

查看:142
本文介绍了当传统的ASP不打烊的记录,会发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中的遗留应用程序,我看到散落在大量的网页没有关闭记录集。


  • 这是否有什么后果?

  • 自动关闭是否连接?

  • 是在每个请求的结束释放的资源?

更新:

TXN!


解决方案

  

      
  • 这是否有什么后果?

  •   

资源没有得到迅速释放,并根据code性能将受到影响的其余部分。



  

      
  • 自动关闭是否连接?

  •   
  • 是在每个请求的结束释放的资源?

  •   

在页面执行结束时,所有连接都将终止,并释放所有资源。有些人的身影,因为这种情况下,没有必要担心显式关闭连接和/或释放资源。

所有的事情都是平等的,这个依赖是不是因为你永远不知道事情怎么会在交通繁忙发挥出来是鼓励 - 这就是为什么所有好的教程/教练会告诉你,只有当你需要打开,并只要你完成发布。

In legacy applications at work, i see not closed recordsets scattered on lots of pages.

  • What consequences does this have?
  • Does the connection close automatically?
  • Are resources released at the end of every request?

Update:

txn!

解决方案

  • What consequences does this have?

Resources don't get freed up as quickly, and depending on the rest of the code performance will suffer.

  • Does the connection close automatically?
  • Are resources released at the end of every request?

At the end of page execution, all connections are terminated and all resources released. Some people figure that since this happens, there is no need to worry about explicitly closing connections and/or releasing resources.

All things being equal, reliance on this is not something that is encouraged as you never know how things will play out in heavy traffic - which is why all the good tutorials/instructors will tell you to open only when you need, and release as soon as you are done.

这篇关于当传统的ASP不打烊的记录,会发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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