Avoiding Stored Procedure Metadata Requests

  • Filter
  • Time
  • Show
Clear All
new posts

  • Avoiding Stored Procedure Metadata Requests

    Hi all,

    Do you how to prevent the mysql connector/net asking the server for the stored procedure metadata each first execution? I can't seem to find any place that explains how to do that properly.

    I've tried providing as much information about the SP parameters as possible, but nothing works.
    Here is an example:

    When launching a stored procedure from .net, I see this in the general log:

    22 Init DB db_name22 Query SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE OUTINE_SCHEMA='db_name' AND ROUTINE_NAME='mySP'22 Query SHOW CREATE PROCEDURE `db_name`.`mySP`22 Query call mySP (10)

    It makes sense to get the stored procedure code if the DAL needs to know the data types of the parameters, but it does that even when I am strong-typing the variables as much as I can.
    In this case:

    MySqlParameter param1 = new MySqlParameter("?p_param", MySqlDbType.Int32);param1.Value = 10;param1.Direction = ParameterDirection.Input;param1.IsNullable = false;param1.MySqlDbType = MySqlDbType.Int32;cmd.Parameters.Add(param1);cmd.E xecuteNonQuery();

    Is there a correct way to do this that avoids those queries?

    Thanks in advance!

  • #2
    I suspect not, but I might be wrong.