ado.net first load delay

  • Thread starter Alejandro Bibiano González
  • Start date
A

Alejandro Bibiano González

I have public the same message in microsoft.public.dotnet.languages.csharp,
but I think this is the correct newsgrup.

I have a form with a ComboBox. On the form Load event I load the ComboBox
with data from an Oracle Database (using DataSource and DataAdapter).

All works fine, but the first time I open the form, it has a delay before it
open because he has to load the data (only 5 rows).


The strange think, is that when I close the form and reopen it, the form is
opened instantly.

I think it has to do with the Ado.NET connection.

What can I do to open the form faster the first time?
 
C

Cowboy \(Gregory A. Beamer\)

It is more likely compilation. The only way to avoid this hit is to ngen the
assembly so the JIT compilation does not occur. If you can determine that it
is the connection, I would aim for loading common (static?) data ahead of
the form click and caching it. The hit will still be there, but it will be
hidden from users.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

****************************************************************************
****
Think Outside the Box!
****************************************************************************
****
 
S

Steven Bras [MS]

I don't think that 5 seconds is unusual for a connection to Oracle; bear in
mind that the framework's managed Oracle provider must load the Oracle
client components on the first connection attempt. Thereafter, I believe
they'll still be in memory and more rapidly accessed.

Steven Bras, MCSD
Microsoft Developer Support/Visual Basic WebData

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
 
B

Bernie Yaeger

Hi Steve,

He didn't say 5 seconds; he said 5 rows. My guess is the delay is greater
than that. The question is how long? If it's 10 - 15 seconds, it's
acceptable; if longer, something is wrong...

Bernie Yaeger
 
A

Alejandro Bibiano González

It's about 5 seconds. My questions is how can I know if the problem is the
Oracle connection, or the JIT compiler?
 
A

Alejandro Bibiano González

Thanks for response

I have a class with a static method that return my connection object
(therefor I always use the same connection). I connect to the database just
opening my application, but I continue with the delay problem when I open
the first time a form. I think it's a JIT complier question...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top