Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Oledb connection pooling?
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Oledb connection pooling?
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Miscellaneous
Thread ID:
01502760
Message ID:
01502760
Views:
98
Check out the following tests
Testconnections2 returned 0.23 seconds, Testconnections3 returned 4.68 seconds, that's a factor of 20 slower. If there is any pooling done here, it's either not working for me, or it's kind of not very effective.
What am I missing?
    Public Sub testConnections2()
        Dim cmd As New OleDbCommand
        Dim da As New OleDbDataAdapter(cmd)
        Dim conn As New OleDbConnection
        Dim dt As New DataTable
        conn.ConnectionString = My.Settings.b040_beConnectionString
        conn.Open()
        cmd.Connection = conn
        Dim n As Long
        Dim t As Date = Now
        For i As Integer = 1 To 100
            cmd.CommandText = "select Art_id from Artikel where Art_nr = '  125'"
            n = cmd.ExecuteScalar()
            cmd.CommandText = "select * from artikel where Art_Nr = '  125'"
            da.Fill(dt)
        Next
        Debug.Print((Now() - t).ToString)
    End Sub
    Public Sub testConnections3()
        Dim cmd As New OleDbCommand
        Dim da As New OleDbDataAdapter(cmd)
        Dim conn As New OleDbConnection
        Dim dt As New DataTable
        conn.ConnectionString = My.Settings.b040_beConnectionString
        cmd.Connection = conn
        Dim n As Long
        Dim t As Date = Now
        For i As Integer = 1 To 100
            conn.Open()
            cmd.CommandText = "select Art_id from Artikel where Art_nr = '  125'"
            n = cmd.ExecuteScalar()
            cmd.CommandText = "select * from artikel where Art_Nr = '  125'"
            da.Fill(dt)
            conn.Close()
        Next
        Debug.Print((Now() - t).ToString)
    End Sub

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Next
Reply
Map
View

Click here to load this message in the networking platform