To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

HOME News MS SQL Oracle DB2 Access MySQL PHP Scripts Books Links DBA Talk


Go Back   Database Journal Forums > Miscellaneous > General Database Discussions

General Database Discussions Discuss any database topic not covered in any other forum on this site

Reply Post New Thread
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-09-2003, 05:21 PM
kerroppa kerroppa is offline
Junior Member
 
Join Date: Jan 2003
Posts: 5
ASP, SQL Process, and SQLDMO

Hi all,

Our ASP scripts send SQL statements (as a stored procedure) to SQL Agent to process the requested jobs in the background. After the job execution, the Process ID stays in the server and waits for next command with sleeping status. Since this process does not go away, next job execution adds another process and eventually, the server is overloaded with these processes and dies. (Under Process Info of SQL Svr Enterprise Management, there are hundreds of process IDs with sleeping status and awaiting command status. Most of these process are executed by SQLDMO because Application column indicates as SQLDMO_xxx (xxx denotes for digits).)

We make sure of opening and closing the connectinos from the scripts, but this problem does not go away. Does anyone have any ideas how to solve this problem? How come those processes don't go away after the job execution? Any comments would be greatly appreciated.

BTW, we use SQL Server 2000.

Thanks in advance,
kerroppa
Reply With Quote
  #2  
Old 01-09-2003, 06:05 PM
JBane JBane is offline
Registered User
 
Join Date: Dec 2002
Posts: 181
Are you explicitly disconnecting or just destroying the object?

i.e.

Set SQLServer = Nothing

instead of

SQLServer.DisConnect



Jeff
Reply With Quote
  #3  
Old 01-09-2003, 06:52 PM
kerroppa kerroppa is offline
Junior Member
 
Join Date: Jan 2003
Posts: 5
Hmm... I think we are only destroying the object; howenver, we close the connections by doing;

SQLServer.Close

Is this different from "SQLServer.DisConnect"?

TIA,
kerroppa
Reply With Quote
  #4  
Old 01-09-2003, 08:48 PM
JBane JBane is offline
Registered User
 
Join Date: Dec 2002
Posts: 181
I'm not positive how the object.close behaves, but I know destroying the object doesn't release the connection, standard DMO behavior. You might try explicity issuing the disconnect and see if that resolves your issue.

Jeff
Reply With Quote
  #5  
Old 01-10-2003, 05:30 PM
kerroppa kerroppa is offline
Junior Member
 
Join Date: Jan 2003
Posts: 5
Hi,

This may sound a silly question, but here goes...

We have following objects created to send jobs to SQL Agent;

------
SET theServer = Server.CreateObject("SQLDMO.SQLServer")
SET theJob = Server.CreateObject("SQLDMO.Job")
SET theStep = Server.CreateObject("SQLDMO.JobStep")
SET theJobSchedule = Server.CreateObject("SQLDMO.JobSchedule")
SET sendAfter = Server.CreateObject("SQLDMO.JobStep")
SET failed = Server.CreateObject("SQLDMO.JobStep")

theServer.Connect...

...
-----

And when we destroy objects/close the connection, we do this.

-----
SET theServer = Nothing
SET theJob = Nothing
SET theStep = Nothing
SET theJobSchedule = Nothing
SET sendAfter = Nothing
SET failed = Nothing
SET allJobs = Nothing
SET theResults2 = Nothing
theConnection2.DisConnect
SET theConnection2 = Nothing
-----

Since only theConnection2 object was explicitly opened the connection to the database, we also explicitly terminate the connection. For other objects, we can only destory them, right?

Thanks in advance,
kerroppa
Reply With Quote
  #6  
Old 01-10-2003, 05:40 PM
JBane JBane is offline
Registered User
 
Join Date: Dec 2002
Posts: 181
Yes, but disconnect before you destroy any other objects.

Jeff
Reply With Quote
  #7  
Old 01-10-2003, 05:46 PM
kerroppa kerroppa is offline
Junior Member
 
Join Date: Jan 2003
Posts: 5
Made a mistake on my part. It should've been like this;

-----
theServer.disConnect
SET theServer = Nothing
SET theJob = Nothing
SET theStep = Nothing
SET theJobSchedule = Nothing
SET sendAfter = Nothing
SET failed = Nothing
-----

Thanks Jeff.
kerroppa
Reply With Quote
  #8  
Old 01-13-2003, 11:30 AM
kerroppa kerroppa is offline
Junior Member
 
Join Date: Jan 2003
Posts: 5
Hi,

The properties of leftout processes indicate that "exec msdb..sp_help_job". Is this something that my script is calling? I just wonder why banch of those processes are hanging there with the same properties...

Any inputs are appreciated.

TIA,
kerroppa
Reply With Quote
Reply Post New Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:04 AM.


DatabaseJournal Recent Articles


 » Preparing To Upgrade Access Tables to SQL ...

 » Microsoft Windows PowerShell and SQL Serve...

 » New MySQL Enterprise with Query Analyzer B...

 » Quest Software Strengthens Committment to ...

 » Oracle Unveils New Event-Driven Middleware...

Search Database Journal:
 





Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.