You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NpgsqlTransaction.Connection should be accessible after the transaction has completed #3384
I update in the foreach loop and commit after the loop is over. The previous version did not have this error. Can you give information about the reason? Thanks for help.
changed the title [-]Npgsql 5.0.0.0 transaction completed and it is no longer available[/-][+]NpgsqlTransaction.Connection should be accessible after the transaction has completed[/+]on Dec 11, 2020
Activity
YohDeadfall commentedon Nov 27, 2020
Could you provide a sample code?
huseyingoztok commentedon Nov 27, 2020
I have code similar to this example
https://stackoverflow.com/questions/65029805/npgsql-5-0-0-0-transaction-completed-and-it-is-no-longer-available
huseyingoztok commentedon Nov 27, 2020
There is an update process to two different tables in the code. Indent has been bad. Sorry.
`foreach (var item in items)
{
try
{
var fooList = Db.GetDefaultRepo().GetMany(a => !a.IsDeleted && a.PropId == item.PropId).FetchAll(trackChanges: true);
roji commentedon Nov 29, 2020
The issue seems to be that we throw when NpgsqlTransaction.Connection is accessed on a completed transaction:
@vonzshik are you interested in taking a look at this?
Minimal EF6 repro
vonzshik commentedon Nov 29, 2020
@roji ok
izvictor commentedon Dec 2, 2020
Hello,
Do you have a relase date planned for 5.0.1 milestone?
Thanks
roji commentedon Dec 5, 2020
This will happen in the coming days, probably right after .NET and EF Core 5.0.1 are released
Fixed access to the connection property of the transaction
Fixed access to the connection property of the transaction
[-]Npgsql 5.0.0.0 transaction completed and it is no longer available[/-][+]NpgsqlTransaction.Connection should be accessible after the transaction has completed[/+]