开发者

ODP.NET calls hanging when used with Casini

I am having a problem trying to instantiate Oracle.DataAccess.Client objects in a web application.

To test this I created a new asp.net web application and inserted the following code into the code behind of Default.aspx:

    protected void Page_Load(object sender, EventArgs e)
    {
        Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection();
        Oracle.DataAccess.Client.OracleCommand client = new Oracle.DataAccess.Client.OracleCommand(); 
    }

The call to OracleConnection() will take 2.5 minutes to return but OracleCommand() will be fast. If I reverse the order of the 2 calls the opposite will occur and OracleCommand() will hang instead.

If I deploy this code to IIS, it works fine so my problem is only with Casini. Has anyone come across this problem before or have any ideas for me? I have tried reinstalling the oracle client and visual studio, I have even tried an older version of the oracle client (112012 instead of 112021) with the same results.

Also, I am working on a new Windows 7 machine and开发者_如何学Python I did not experience this problem on my previous machine.

Thanks.


Maybe you should consider using IIS Express instead of Cassini?


If you do this, then immediately hit reload and hit the page again without restarting the debugger, do you see the same thing?

I've seen a delay the first time I hit something that calls ODP.net in my projects as the Oracle client is loaded, but never anything this long. That it could be related to the web server is very odd.


The problem is which ODP.Net version you're using: 32 or 64 bits.

Visual Studio runs as a 32-bits process, no matter if your OS is 32 or 64 bits. Casini also runs as a 32-bits process. On IIS 7.5 (on Win7-64 bits) you can configure Application Pools to run as 32 or 64-bits.

So, if you're using ODP.Net 64 bits and Casini(32-bits), you'll get problems. But when you run it on IIS, it works fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜