Blog Stats
  • Posts - 45
  • Articles - 0
  • Comments - 16
  • Trackbacks - 20

 

now it's not there, now it is

I have an application that connects to the database on startup. This afternoon while trying to bring it up on a test machine, I ran into a funky problem. After modifying the database connection string, I got a SQL server not available message. I went, huh? Thinking it must have been some cached stuff, I hit refresh on the browser - VOILA! the login page comes up. Then, I try to log in - it combs out with a connection error. I tried this several times with different DB servers and each time the same thing happened. As I sat there thinking that there was a ghost in the machine or a MITM attack was in progress - one of my co-workers walked over. I told him the problem I was having - he smiled and said "It's a puzzle - figure it out"

As I sat there with my head in my hands, it hit me. What happens is that the first time the application comes up, it tries to connect to the DB as part of global.asax. When it fails, it spews out the message. When I hit refresh, global.asax (and therefore the DB connection) never runs - therefore it does not bomb out but shows the required screen. When I tried to log in, the database connection is attempted and fails as it is supposed to. Turns out, I got the connection string was messed up because the user password was changed on all the DBs and I failed to get a note of this. Interesting endeavor though. :)


Feedback

No comments posted yet.


Post a comment





 

 

 

Copyright © Rishi Pande