Results 1 to 7 of 7

Thread: Code Behind Stops Executing

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    Tulsa,Ok
    Posts
    262

    Code Behind Stops Executing

    Guys,

    I deployed a new company intranet site last friday and it worked great for the last half of the day. Today it has twice stopped running the code behind for the pages. We have a cutoff list on the main site that shows the status of our variuous locations around the country. When the code behind stops, the cached page loads but it does not pull any information from the database.

    I can fix it by copying the dll back onto the server, then it runs fine for about an hour then same thing.

    Has anyone seen this before?

    Thanks,

    Jerel

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464

    Re: Code Behind Stops Executing

    Originally posted by Phenglai
    Guys,

    I deployed a new company intranet site last friday and it worked great for the last half of the day. Today it has twice stopped running the code behind for the pages. We have a cutoff list on the main site that shows the status of our variuous locations around the country. When the code behind stops, the cached page loads but it does not pull any information from the database.

    I can fix it by copying the dll back onto the server, then it runs fine for about an hour then same thing.

    Has anyone seen this before?

    Thanks,

    Jerel
    Cached page? Are you caching your pages in asp.net? If so, they will not be running the code behind if the cache hasn't expired. That is the point of caching pages.

    If you are refering to the browser cache, well, refresh and see if that works.

    Also, are there anything in the logs? Is the aspnet worker process stopping for some reason?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    Tulsa,Ok
    Posts
    262
    hellswrath,

    Thanks for your help. You have helped me a ton while I learn ASP.NET and roll it out at the same time.

    The worker process is running but it grows and grows and grows, at last check about 10 mins ago it was upto 57Meg and it has been up to 80 meg before.

    I just changed the setting of the assembly to run as server side so the garbage collector would run faster.

    As for caching the pages, I thought I had that disabled since data is always being added and removed from the page.

    Can you cache a single page or do you have to cache the assembly. I have a dll that has 8 pages so far as we redo the intranet site and some of the pages we need to add wil just be static but a lot of them we are making data driven pages.

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Each page can be cached individually, as well as each control. Look at the @Page directive area of the page in HTML view (very top) and see if any caching is happening at that level. Do the same for each user control as well.

    If no luck there, check the web.config file to see if any caching is happening there.

    Another tool to use when you are debugging on a live server is Tracing. It comes at a performance hit though, so use it only when you need to. You can turn on tracing for pages either in the @Page directive, or in the web.config file. You can have the trace information outputted on the pages themselves, or in a single axd file on the server. Look up tracing in the msdn library for more information.

    I wouldn't worry so much about how much memory is being used normally because the CLR manages that pretty well and will use what it can and no more, but 80 megs sounds a tad high. Are you storing a lot of information in Session state or Application state variables?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    Tulsa,Ok
    Posts
    262
    After the last post I started looking at caching and I am not caching any pages within the pages themselves. I will take a look at the web.config file.

    I do not have session or state variables. Basically all the pages are doing are grabing info from a database and throwing it onto a page. I dynamically build a table and place all the info in the table. Some pages allow the user to change the data or add new data but thats pretty much it in a nutshell.

    I will look into tracing and see what I can find. I tried locking onto the worker process to debug but I do not have VS.net installed on the live machine so need to install it to what its doing.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    Tulsa,Ok
    Posts
    262
    OK,

    After doing more digging, I have found the error that eventually pops up is dealing with max connections to the database. I have in my code for every open statement I have a close statement.

    Am I over looking something here. I have try/catch/finally blocks set up and each finally block contains conn.Close() to close the connection I opened.

    Thanks,

    Jerel

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Don't know, but if you are using SQL Server, use the data application block. You just pass it a connection string and it manages the connection for you.

    http://msdn.microsoft.com/library/de...ml/daab-rm.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width