Page 1 of 1

DevartDataContext() using an open connection

Posted: Thu 11 Dec 2008 00:05
by Zoran
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.

Posted: Thu 11 Dec 2008 10:59
by AndreyR
Please post the value of the ConnectionString property.

Posted: Thu 11 Dec 2008 12:10
by Zoran
DATABASE=***;USER ID=***;PASSWORD=***;SERVER=localhost;UNICODE=true

Posted: Fri 12 Dec 2008 10:01
by AndreyR
Thank you for your feedback. We will investigate this issue.
As a temporary workaround, set the Persist Security Info property of the connection to true.

Posted: Sat 13 Dec 2008 11:07
by Zoran
After extending the connection string, the problem disappeared.

Posted: Thu 18 Dec 2008 16:51
by Zoran
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"

Posted: Fri 19 Dec 2008 10:20
by AndreyR
We have changed the behaviour, now there is no reopen. Look forward to the next build.

Posted: Thu 29 Jan 2009 14:41
by Zoran
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.

Posted: Thu 29 Jan 2009 15:04
by AndreyR
Thank you for the report, we will investigate this issue. I will let you know about the results.

Posted: Mon 02 Feb 2009 09:28
by AndreyR
We have fixed the problem with connection closing. Look forward to the next build.

Posted: Fri 27 Feb 2009 22:54
by Zoran
I confirm that the problem has been fixed.