Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Session Objects and database connection


Message #1 by d.mcivor@l... on Wed, 31 Jan 2001 16:51:18 -0000
Hi



I need to store data from a database between pages.  I?m currently

creating a record set in the Session object like so.



Set Session("tempRecordSet") = Server.CreateObject("ADODB.Recordset")

Session("lpwRecordSet").CursorLocation = 3



I then connect to the database and get the data?



	Set con = Server.CreateObject("ADODB.Connection")

	con.Open strDefaultDatabase, strDefaultUsername,

strDefaultPassword	Session("lpwRecordSet").open sql, con



I then use the following commands to create a ?disconnected recordset? and

close the connection.



Set Session("lpwRecordSet").ActiveConnection = Nothing

con.Close

set con = nothing



Note: this is not the whole code, simple the highlights.



When I run the application multiple time I encounter problems connecting

to the database.  I used netstat to check the TCP connections to the

database and discovered a number of unclosed connection in a TIME_WAIT

state.



Why are these connections not dropped when I have set the connection

object to nothing?

Does the disconnected record set still hold a connection to the database?



Thanks David


  Return to Index