DevartDataContext() using an open connection
DevartDataContext() using an open connection
DevartDataContext(String connectionString) works normally.
DevartDataContext(System.Data.IDbConnection connection) reports "FATAL: password authentication failed for user... " when querying data. The provided connection is already open and was in use. DevartDataContext shouldn't close and open it again, should it? The error looks like it tries to open it again.
DevartDataContext(System.Data.IDbConnection connection) reports "FATAL: password authentication failed for user... " when querying data. The provided connection is already open and was in use. DevartDataContext shouldn't close and open it again, should it? The error looks like it tries to open it again.
More precisely, no error is reported, but it seems that a new connection is opened so the transaction context is lost.
Metacode:
//... transaction in progress
cn.CommandText = "UPDATE Item SET Name='ABC' WHERE Key='1'";
cn.executeNonQuery();
DevartDataContext dc = new DevartDataContext(cn);
string s = dc.Items.Single(k => k.Key == "1").Name; //s is not "ABC"!
cn.commit();
dc = new DevartDataContext(cn);
s = dc.Items.Single(k => k.Key == "1").Name; //s is "ABC"
Metacode:
//... transaction in progress
cn.CommandText = "UPDATE Item SET Name='ABC' WHERE Key='1'";
cn.executeNonQuery();
DevartDataContext dc = new DevartDataContext(cn);
string s = dc.Items.Single(k => k.Key == "1").Name; //s is not "ABC"!
cn.commit();
dc = new DevartDataContext(cn);
s = dc.Items.Single(k => k.Key == "1").Name; //s is "ABC"
I installed .20 version instead of .16. The application crashed. The problem is for example in this sequence:
//... dataContext instantiated using an open connection
Devart.Data.Linq.Table all = dataContext.GetTable();
return all.Single(c =>true);
//... here the connection is no more open and the next operation causes an error
After returning to .16 version the problem disappeared since the connection remained open.
//... dataContext instantiated using an open connection
Devart.Data.Linq.Table all = dataContext.GetTable();
return all.Single(c =>true);
//... here the connection is no more open and the next operation causes an error
After returning to .16 version the problem disappeared since the connection remained open.