0

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 I did not experience this problem on my previous machine.

Thanks.

Bronumski
  • 14,009
  • 6
  • 49
  • 77
zaq
  • 2,571
  • 3
  • 31
  • 39

3 Answers3

0

Maybe you should consider using IIS Express instead of Cassini?

Joel Mueller
  • 28,324
  • 9
  • 63
  • 88
  • I'll take a look. I like the convenience of Cassini for dev but this may be a decent work around. – zaq May 11 '11 at 22:07
  • Configure it right and IIS Express works exactly the same way as Cassini, except for actually being IIS. – Joel Mueller May 11 '11 at 22:36
  • This seems to work really well. It still bugs me that it won't work in Cassini on Windows 7 since it did on my previous Windows XP machine, but IIS Express seems like a good alternative. – zaq May 12 '11 at 16:35
0

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.

Tridus
  • 5,021
  • 1
  • 19
  • 19
  • Yes, the delay is only the first time the page is hit. In fact only the first time any particular ODP object is instantiated. The delay will not happen again until I stop Cassini and start it again. – zaq May 11 '11 at 22:09
  • IIS must be doing something to keep ODP.net loaded then, whereas it shuts down when Cassini goes away. This is still an abnormally long delay. Are you using the beta ODP.net? Is it a full "thick" Oracle client install, or just the .net stuff? – Tridus May 12 '11 at 10:17
  • It's the full Oracle client install. I've pretty much given up on Cassini at this point. I tried out IIS Express as suggested above and it works fine. – zaq May 12 '11 at 16:34
0

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.

Nathan
  • 2,705
  • 23
  • 28