连接& ADO.NET中断开的体系结构差异 [英] Connected & Disconnected architecture differences in ADO.NET

查看:56
本文介绍了连接& ADO.NET中断开的体系结构差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已被多次询问..但我对网上找到的所有差异答案感到困惑。



为什么称为连接架构ADO.NET中连接的体系结构?



为什么在ADO.NET中断开连接的体系结构称为断开连接的体系结构?



我知道,Connected意味着只读,只转发等...而且断开连接意味着你可以离线工作数据。



但我的问题是 -



1。数据库命中数是否有差异?

2.在这两种情况下,何时打开和关闭与DB的连接?

3.为什么在获取数据并断开连接时我们必须在断开连接的架构中使用Connection.Close()?我感到困惑b / w关闭&断开连接?




请帮我澄清这些疑惑......我只是想进去看看究竟发生了什么。



谢谢。

I know this question has been asked multiple times.. But I m little confused with all the diff answers i found in web.

Why connected architecture is called connected architecture in ADO.NET ?

Why disconnected architecture is called disconnected architecture in ADO.NET ?

I know, Connected means read-only, forward-only etc... and disconnected means you can work offline with data.

But my questions are -

1. Is there any difference in # of hits to database?
2. In both cases, when the connection to DB is opened and closed?
3. Why do we have to use Connection.Close() in disconnected architecture when it gets the data and disconnects the connection?Am i getting confused b/w Close & Disconnect?


Please help me in clarifying these doubts... I just want to go in and see what's happening exactly.

Thank you.

推荐答案

1。命中数没有区别,因为没有命中取决于你如何编写你的程序,而不是你正在使用什么类型的连接。

但是在断开模式的某个地方你可以管理更少每个数据库连接的点击次数。

2.在两种情况下,DB都是打开和关闭的,但在连接环境中,用户会占用连接,直到他完成所有查询,这会减慢网络速度,在断开连接时,您获取数据并关闭连接,以便其他用户可以免费使用。

3.当您请求打开与数据库服务器的连接时,您的连接将被打开,并且连接已完成池,直到你不会关闭连接,它仍然在池中打开,所以要释放你需要关闭它的源。断开连接没有关闭连接。
1. There is no difference in # of hits, as no of hits depends upon how you have coded your program, its not about what type of connection you are using.
But somewhere in disconnected mode you can manage less # of hits for each db connection made.
2. Its true that in both cases DB is opened and closed, but in connected environment user occupy the connection until he finishes all his queries which slow down the network, in disconnected you fetch the data and close the connection so its free for other users.
3. When you request to open a connection with db server, your connection get opened and an entry is made in connection pool, until you will not close the connection, it remains open in pool, so to free the source you need to close it. Disconnect is not closing the connection.


这篇关于连接& ADO.NET中断开的体系结构差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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