Description:
Can't create more than max_prepared_stmt_count statements.
Initial issue observed with the 8.0.32 driver. Same code works on on 5.3.13, fails on 8.0.32.
Calling '.Dispose' on the OdbcCommand object method resolves the incremental count.
However, subsequent testing reveals a memory leak(?) when run over an extended period.
Replicating this with ODBC 5.3.13 does not experience these problems.
How to repeat:
Use "n" call/long running process against the DB.
a) Greater than max_prepared_stmt_count and re memory leak, greater than 100,000 I/Os.
LogSysMsgcmd = New OdbcCommand("insert into " & DB__SYSTEM_APP_LOG & " ( " _
& DB_APP_LOG_DATE_TIME & "," _
& DB_APP_LOG_USERNAME & ", " _
& DB_APP_ID & ", " _
& DB_APP_MSG_TYPE & ", " _
& DB_APP_MESSAGE & ", " _
& DB_APP_LOG_INIT_MSG_ID & " )" _
& " values (" & SYSDATETIME & "," _
& SYSTEMUSER & "," & "?,?,?,?" & ");")
LogSysMsgcmd.Connection = _ODBCConnection
LogSysMsgcmd.Parameters.Add(DB_APP_ID, OdbcType.Char, 20, DB_APP_ID)
LogSysMsgcmd.Parameters.Add(DB_APP_MSG_TYPE, OdbcType.Char, 1, DB_APP_MSG_TYPE)
LogSysMsgcmd.Parameters.Add(DB_APP_MESSAGE, OdbcType.VarChar, DBC_APP_MESSAGE_LENGTH, DB_APP_MESSAGE)
LogSysMsgcmd.Parameters.Add(DB_APP_LOG_INIT_MSG_ID, OdbcType.BigInt, 12, DB_APP_LOG_INIT_MSG_ID)
LogSysMsgcmd.Parameters(DB_APP_ID).Value = AppID
LogSysMsgcmd.Parameters(DB_APP_MSG_TYPE).Value = MsgType
LogSysMsgcmd.Parameters(DB_APP_MESSAGE).Value = LogMsg
LogSysMsgcmd.Parameters(DB_APP_LOG_INIT_MSG_ID).Value = InitLogMsgId
Dim AppMsgObj As Object = LogSysMsgcmd.ExecuteNonQuery()
& optionally:-
LogSysMsgcmd.Dispose()
Suggested fix:
"Resolved" such that the 8.0.x driver runs with the same results as the 5.3.13 driver with respect to Insert/s.