Too many sessions already active

  • Thread starter Thread starter bill
  • Start date Start date
B

bill

I have been "Googling" for about an hour and am turning up squat! I just
started receiving this error when trying to log into a MS Access database
from a vb .net web application. Recycling IIS seems to temporarily fix the
problem, but I am at a loss on how to view the total # of "active" sessions,
etc... any ideas or suggestions would be greatly appreciated!



Could not start session. Too many sessions already active.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Could not start
session. Too many sessions already active
 
You are not very descriptive.
What do you mean by "log into" MS Access.....

Most likely your application does not close DB Connections. hence the
message when too many are open
Show us your code where you retrieve data from MS Access.

George.
 
Sorry about that.... here is a snip of sample code. We have Close
statements throughout the pages, so I am thinking it isn't that... but I
could be missing something?

Dim myConn As New OleDbConnection(AppSettings("myConnectionString"))
Dim mySQL As String = "SELECT * FROM myTable WHERE ID=" & myID
Dim cmd As New OleDbCommand(mySQL, myConn)
Dim da As New OleDbDataAdapter
Dim ds As New DataSet
da.SelectCommand = cmd
da.Fill(ds, "myTable")
myConn.Close()

note that myConnectionString is set to
"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=D:\data\myDatabase.mdb" />
 
Your code has a problem in case there is an error thrown. Connection will
never be closed...
Proper way would be to enclose it with try... catch ( do not know how it is
in VB)

George
 
close your connection in the "Finally" section of your try catch statement
provided it is not null or nothing.
Are you using XP as your web server for testing then it might have
limitations on the number of connections to it.
 
Here is what is strange... we never got those errors UNTIL I put in the
close statements. Prior to last week, the database connections were never
programmatically being closed... it just doesn't make sense to me...
 
Back
Top