Skip to content

SubmitUpdates() ordering? #321

Open
Open
@ingted

Description

@ingted

Description

When using SetColumn/SetColumnOption with null/None, not sure why recently it bumps to "Parameter {ParameterName} must be set" Exception in Npgsql.

https://github.com/npgsql/npgsql/blob/dev/src/Npgsql/NpgsqlParameter.cs
Near line 628

Repro steps

Please provide the steps required to reproduce the problem

match value with
| null ->
se.SetColumnOption(idx, None)
| _ ->
se.SetColumn(idx, value)

After I use (from reflected method which I need to keep IDbConnection opened for batch transaction)
something like:

isdc.SubmitChangedEntity(se)
isdc.SubmitPendingChangesNoClose(dbConn)

Exception raised...

Expected behavior

I remembered I don't need to specified DBNull.Value before...
(In the fact, even I specified DBNull.Value, it still not works)
And null/None value should work.

Actual behavior

But recently when it doesn't work...

Known workarounds

#320

Maybe what I bumped into was caused by my missed reflection...
If so, please just ignore me...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions