Skip to content

Insert error about multithreading #303

@ellenfier

Description

@ellenfier

I have met the problem:

MySql.Data.MySqlClient.MySqlException:“Fatal error encountered during command execution.”
MySqlException: Parameter '@i_1' must be defined.

And I noticed the key of 'dynamicParameters.ParamInfo' isn't correct. some key values are @i_1, @i_2..., and some are the name of the Property, like FirstName, LastName.

So I modified part of the code of 'SqlGeneratorImpl' for myown and now it works fine.
Like this:
'SqlGeneratorImpl.Insert(IClassMapper classMapper)'

        AllColumns = GetColumns().Select(c => new Column
        {
            Alias = c.Alias,
            ClassMapper = c.ClassMapper,
            Property = c.Property,
            SimpleAlias = $"{Configuration.Dialect.ParameterPrefix}i_{i++}",
            TableIdentity = c.TableIdentity,
            Table = c.Table
        }).ToList<IColumn>();

        //AllColumns = GetColumns().ToList();
        //AllColumns = AllColumns.Select(c => new Column
        //{
        //    Alias = c.Alias,
        //    ClassMapper = c.ClassMapper,
        //    Property = c.Property,
        //    SimpleAlias = $"{Configuration.Dialect.ParameterPrefix}i_{i++}",
        //    TableIdentity = c.TableIdentity,
        //    Table = c.Table
        //}).ToList<IColumn>();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions