DevartDataContext() using an open connection

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Zoran
Posts: 44
Joined: Thu 28 Apr 2005 21:55
Location: Zagreb, Croatia

DevartDataContext() using an open connection

Post by Zoran » Thu 11 Dec 2008 00:05

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.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 11 Dec 2008 10:59

Please post the value of the ConnectionString property.

Zoran
Posts: 44
Joined: Thu 28 Apr 2005 21:55
Location: Zagreb, Croatia

Post by Zoran » Thu 11 Dec 2008 12:10

DATABASE=***;USER ID=***;PASSWORD=***;SERVER=localhost;UNICODE=true

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 12 Dec 2008 10:01

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.

Zoran
Posts: 44
Joined: Thu 28 Apr 2005 21:55
Location: Zagreb, Croatia

Post by Zoran » Sat 13 Dec 2008 11:07

After extending the connection string, the problem disappeared.

Zoran
Posts: 44
Joined: Thu 28 Apr 2005 21:55
Location: Zagreb, Croatia

Post by Zoran » Thu 18 Dec 2008 16:51

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"

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 19 Dec 2008 10:20

We have changed the behaviour, now there is no reopen. Look forward to the next build.

Zoran
Posts: 44
Joined: Thu 28 Apr 2005 21:55
Location: Zagreb, Croatia

Post by Zoran » Thu 29 Jan 2009 14:41

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.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 29 Jan 2009 15:04

Thank you for the report, we will investigate this issue. I will let you know about the results.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 02 Feb 2009 09:28

We have fixed the problem with connection closing. Look forward to the next build.

Zoran
Posts: 44
Joined: Thu 28 Apr 2005 21:55
Location: Zagreb, Croatia

Post by Zoran » Fri 27 Feb 2009 22:54

I confirm that the problem has been fixed.

Post Reply