ASP.NET架构:我错过了什么 [英] ASP.NET architecture : am I missing something

查看:66
本文介绍了ASP.NET架构:我错过了什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨伙计们,


我的网站遇到一个小问题让我头疼:它

不能同时拥有2个用户时间(非常讨厌,如你所见:) :)

我想我错过了ASP.NET架构中的一些东西,但我看不出为什么

问题就在于我的问题连接到数据库。


我有一个拥有SQLConnection对象的单元。

当请求页面时,我调用一个创建SQL的类函数

对象。


事实上,这个对象似乎是在连接到网站的用户之间共享的,当请求时同时页面。

这导致一些奇怪的错误告诉connexion已经打开并且错误

就像这样。如果只有一位访客连接到

网站,问题就会消失。


有人能帮帮我吗?

谢谢,


Julien

Hi folks,

I am facing a little problem with my website that gives me an headache : It
can not have 2 users at the same time (quite annoying, as you see:))
I think I miss something in the ASP.NET architecture, but I can not see why
The problem stands in my connection to the database.

I have a unit that owns a SQLConnection object.
When a page is requested I call a class function that creates the SQL
object.

The fact is that this object seems to be shared amongst the users connected
to the site, when requesting a page at the same time.
That results in some odd errors telling connexion already opened and errors
like this. The problem disapears if only one visitor is connected to the
site.

Can someone help me ?
Thanks,

Julien

推荐答案

如果您发布相关代码,

它将是更容易诊断你的问题。


Juan T. Llibre,ASP.NET MVP

ASP.NET FAQ: http://asp.net.do/faq/

Foros de ASP.NET en Espa ?ol: http://asp.net.do/foros/

======================================

" Julien" <无**** @ toto.com>在留言新闻中写道:43 ********************** @ news.free.fr ...
If you post the relevant code,
it will be easier to diagnose your problem.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espa?ol : http://asp.net.do/foros/
======================================
"Julien" <no****@toto.com> wrote in message news:43**********************@news.free.fr...
嗨伙计们,

我的网站面临一个小问题让我头疼:它不能同时拥有2个用户(非常讨厌,如你所见:) :)
我我想我错过了ASP.NET体系结构中的一些内容,但是我看不出原因
问题出在我与数据库的连接上。

我有一个拥有SQLConnection对象的单元。当请求页面时,我调用一个创建SQL对象的类函数。

事实是这个对象似乎是在连接到站点的用户之间共享的,
同时请求一个页面。
这导致一些奇怪的错误告诉connexion已经打开并出现这样的错误。
如果只有一个访问者连接到该站点,问题就会消失。
谢谢,

Julien
Hi folks,

I am facing a little problem with my website that gives me an headache : It can not have
2 users at the same time (quite annoying, as you see:))
I think I miss something in the ASP.NET architecture, but I can not see why
The problem stands in my connection to the database.

I have a unit that owns a SQLConnection object.
When a page is requested I call a class function that creates the SQL object.

The fact is that this object seems to be shared amongst the users connected to the site,
when requesting a page at the same time.
That results in some odd errors telling connexion already opened and errors like this.
The problem disapears if only one visitor is connected to the site.

Can someone help me ?
Thanks,

Julien



还有实施关闭连接功能。这是

连接对象共享


-------

问候,

C#,VB.NET,SQL SERVER,UML,DESIGN模式面试问题书
http ://www.geocities.com/dotnetinterviews/

我的访谈博客
http://spaces.msn.com/members/dotnetinterviews/

Have also implemented the "Close connection" functionality. Is this
connection object shared

-------
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/


好的,但这是delphi代码......即使它很容易理解

我们使用持久层


--------- --------------------

单位myUnit;


界面


类型

TBDEObject = class(TDMObject)

程序doSomething;

(...)
< br $>
实现


var sqlconn:SQLConnection;


函数connect:boolean;

//这个fu nction初始化sqlconn对象


程序TBDEObject.doSomething;

//在此过程中,对象sqlconn用于处理

数据库......

//但这个对象似乎在用户之间共享


------------ -------------------


在另一个单元的初始化部分,我调用myUnit.connect

在最终部分,我打电话给myUnit.disconnect


我希望它有所帮助...


Julien


" Juan T. Llibre" <无*********** @ nowhere.com> aécritdansle message de

news: ur *** ***********@TK2MSFTNGP09.phx.gbl ...
ok, but this is delphi code ... even if it is quite easy to understand
we use a persistance layer

-----------------------------
unit myUnit;

interface

type
TBDEObject = class(TDMObject)
procedure doSomething;
(...)

implementation

var sqlconn : SQLConnection;

function connect : boolean;
// this function initialize the sqlconn object

procedure TBDEObject.doSomething;
// in this procedure, the object sqlconn is used to work with the
database ...
// but this object seems to be shared amongst users

-------------------------------

In the initialization part of another unit, I call myUnit.connect
In the finalization part, I call myUnit.disconnect

I hope it helps ...

Julien

"Juan T. Llibre" <no***********@nowhere.com> a écrit dans le message de
news: ur**************@TK2MSFTNGP09.phx.gbl...
如果您发布相关代码,
将更容易诊断您的问题。

Juan T. Llibre,ASP.NET MVP
ASP.NET FAQ: http://asp.net.do/faq/
Foros de ASP.NET en Espa?ol: http://asp.net.do/foros/
============== ========================
朱利安 <无**** @ toto.com>在消息中写道
新闻:43 ********************** @ news.free.fr ...
If you post the relevant code,
it will be easier to diagnose your problem.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espa?ol : http://asp.net.do/foros/
======================================
"Julien" <no****@toto.com> wrote in message
news:43**********************@news.free.fr...
你好伙计们,

我的网站遇到了一个小问题让我很头疼:
它不能同时拥有2个用户(非常讨厌,如你所见:))我想我错过了ASP.NET架构中的一些内容,但我看不出
为什么
问题出在我与数据库的连接上。

我有一个拥有SQLConnection对象的单位。
当请求页面时,我调用一个创建SQL对象的类函数。

事实是这个对象似乎是在用户
连接到网站,同时请求页面。
这导致一些奇怪的错误告诉connexion已经打开和
这样的错误。如果只有一个访问者与网站连接,问题就会消失。

有人可以帮助我吗?
谢谢,

Julien
Hi folks,

I am facing a little problem with my website that gives me an headache :
It can not have 2 users at the same time (quite annoying, as you see:))
I think I miss something in the ASP.NET architecture, but I can not see
why
The problem stands in my connection to the database.

I have a unit that owns a SQLConnection object.
When a page is requested I call a class function that creates the SQL
object.

The fact is that this object seems to be shared amongst the users
connected to the site, when requesting a page at the same time.
That results in some odd errors telling connexion already opened and
errors like this. The problem disapears if only one visitor is connected
to the site.

Can someone help me ?
Thanks,

Julien




这篇关于ASP.NET架构:我错过了什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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