Answer the question
In order to leave comments, you need to log in
Should I call commit on a transaction in linq2db?
In a web application, I use PostgreSQL as a DBMS and linq2db ORM for it.
When calling any controller methods that use the database, I use the using construct in which I open the context to the database.
And I have a problem, when I open a context and update some record, then after a while the change is rolled back
using(Context db = new Context()){
var SomeEntry = db.SomeTable.FirsrtOrDefault(x => x.id == 1);
SomeEntry.name = "q";
db.Update(SomeEntry);
}
using(Context db = new Context()){
var SomeEntry = db.SomeTable.FirsrtOrDefault(x => x.id == 1);
SomeEntry.name = "q";
db.Update(SomeEntry);
db.CommitTransaction();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question