views:

70

answers:

2

I'm in the process of testing an application and it's database and for this I want to restart my testing each time completely clean. This application loads a large amount of data from Twitter. Therefore, before I start, I delete all data from the database and kill any processes from my web account associated with this application. When I try to then load my application, I get the following error:

[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][SQL Native Client]Communication link failure

I would assume this has something to do with me killing all the related processes in the DB. After some amount of time I am able to run queries again.

  • Does this have something to do with the connections setup information in Coldfusion Administrator?
  • Does it just take some time to reset the connection? Is there any way to get around this?
  • Is there a better way to start fresh and clean when testing the loading?
A: 

I suspect that the error is actually related to how you are "cleaning up", particularly when you say "kill all related processes". By this I'm guessing you go into task manager and actually kill the processes.

I'm also guessing that if you're using SQL Server, you're on windows.

Rather than killing processes, cleanly stop the services associated with your application. Go into the Services Control Panel :

  • Stop your IIS or Apache Service.
  • Stop your ColdFusion Server instance service.

In terms of your database: - Create a script for creating your database schema, tables, views, users and permissions and any default data entries - drop your schema - restart the sql server services if you want to be sure you've created any cached data out. - run the script to create a blank of your database.

You could at this point actually create a database back up and just restore this, but its always handy to have the scripts to run on servers if you don't want to restore a backup.

After this start your coldfusion and iis/apache services.

Stephen Moretti
When I say I am killing the processes, I mean I am doing this inside SQL Management Studio's Activity Monitor. I am not doing it on the windows box itself. I do not have access to the box.
Jason
+2  A: 

By default, ColdFusion pools connection threads. I would guess, based on your comment to Stephen Moretti, that you are killing a connection that CF expects to still be live. That said, I've never had problems killing long DB threads, so this is pure speculation.

I'm not sure what killing these threads gets you, as far as testing goes. Once the page has stopped processing, open DB connections should not push or pull additional data.

Ben Doom
Are you sure about that last statement? For instance, if you have the timeout set to 2 minutes for the page. Will Coldfusion deliver an error to the user (timeout) but continue processing the page until it finishes?
Jason
You have a page that needs a 2 minute timeout on it and yet it still times out? ouch. I would consider how you can refactor this function.I'm inclined to agree with Ben, it sounds like you're killing connections that CF expects to be there. Have you got access to the ColdFusion Administrator or the admin api?
Stephen Moretti
My understanding is that, once the page times out and returns the error, CF no longer process anything on the webserver side. However, if the timeout occurrs during DB processing, the DB may continue to process for as long as it wants.
Ben Doom