Multiple insert statements with protocol 3

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Thu 14 Oct 2010 18:27

Hey.

I am using the new dotConnect for Postgres 4.95.180.0 build.

[Devart]
We have fixed the problem with Unprepared Execute for connections created using DbProviderFactory. The fix will be available in the nearest build, which we plan to release next week.

This seem to have fixed the Unprepared Execute for connections created using DbProviderFactory when Protocol = Ver20. But the problem still exist for when Protocol=Ver30.

[Devart]
The performance problem is caused by the fact that by default Protocol 3 prepares commands before execution. When this preparation is disabled, the performance of Protocol 3 is approximately the same as the one of Protocol 2.

I need a fix for the performance problem when using DbProviderFactory and Protocol = Ver30.

Please run the sample test program you sent me to recreate the problem I am referring too on the latest dotConnect for Postgres version 4.95.180.0

Thanks,

Charlie J.
[/img]

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 15 Oct 2010 16:27

The sample actually had an error: the same command was used for both prepared and unprepared execution. As the UnpreparedExecute property of the connection is set to the command in the constructor of the latter one, the command used in the second test had UnpreparedExecute set to false too.

I've sent you a fixed sample, please check that it was not blocked by your mail filter.

cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Mon 18 Oct 2010 19:00

Great. Thanks. Procotol 3 Unprepared Execute=true; gives me the same performance as Procotol 2.

Charlie J.

cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Wed 15 Jun 2011 20:58

The problem is back. When I set Unprepared Execute=True in my connection string and use Protocol = Ver30, Postgres is preparing the statements on the Server-Side. This was fixed before. How do I disable Server-Side prepared statements using Protocol=Ver30? I am using DBFactoryProvider to create the connnection in my machine.config.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 17 Jun 2011 15:18

I've sent you the sample project in a letter. In our environment, the test is run essentially faster when the 'Unprepared Execution' property is set to true. Please specify if you observe some other behaviour.

cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Fri 17 Jun 2011 15:35

Put a trace on your Postgres Server. With Unprepared Execute=true and Protocol=Ver30, the trace is showing that the Postgres Server is preparing the statements. So it appear that Unprepared Execute=true is not working.

cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Mon 20 Jun 2011 13:47

Any update or reply to the Unprepared Execute=true is not working.

Thanks,

Charlie J.

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Wed 22 Jun 2011 12:45

We couldn't reproduce this issue in our environment. Could you please specify the following:
1) the version of PostgreSQL you are working with;
2) the list of server variables set for this PostgreSQL instance;
3) the exact version (including the build number) of dotConnect for PostgreSQL you are using;
4) the commands you are executing.

If possible, please send us a sample of server logs for the corresponding commands.

cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Wed 22 Jun 2011 13:38

We couldn't reproduce this issue in our environment. Could you please specify the following:
1) the version of PostgreSQL you are working with;
5.30.172

2) the list of server variables set for this PostgreSQL instance;
Default Installed Values

3) the exact version (including the build number) of dotConnect for PostgreSQL you are using;
5.30.172 from the Customer Download

4) the commands you are executing.
Just simple inserts

I am using Entity Framework 4.1 and the DBProviderFactory from my machine.config

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 24 Jun 2011 16:03

Could you please specify the version of the PostgreSQL server you are working with?

I've sent you another test project. Please try running it and specify the log generated on the server for the commands executed in this sample.

cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Fri 24 Jun 2011 16:14

The Postgres SQL Server is version 8.4.1

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Mon 27 Jun 2011 08:18

We couldn't reproduce the issue on the 8.4.1 server either. Could you please run the sample and specify the logs written for the commands executed in it?

cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Mon 27 Jun 2011 13:17

I did not received the sample application your wanted me to run to generate the log. Please email it to [email protected].

Thanks,

Charlie J.

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

Post by AndreyR » Mon 27 Jun 2011 13:27

The Unprepared Execute option works only for the PgSqlConnection.CreateCommand method at the moment.
We are working on improvements for this functionality.
As a workaround, I recommend you to add the following code to your context constructor:

Code: Select all

Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices.UnpreparedCommandExecution = true;

cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Mon 27 Jun 2011 14:12

Ok. Like I stated I am using EntityFramework with my connectionstring in my web.config and using the DDProviderFactory from the machine.config

The problem is back. When I set Unprepared Execute=True in my connection string and use Protocol = Ver30, Postgres is preparing the statements on the Server-Side. This was fixed before. How do I disable Server-Side prepared statements using Protocol=Ver30? I am using DBFactoryProvider to create the connnection in my machine.config.

I really thought this was working before and got broken again.

So you are saying that my configuration using Entity Framework has never worked and I need to use this workaround to get it to work?

Thanks,

Charlie J.

Post Reply