Cannot reference Oracle AND PostgreSQL

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
wdnichols
Posts: 9
Joined: Thu 24 May 2018 12:49

Cannot reference Oracle AND PostgreSQL

Post by wdnichols » Thu 24 May 2018 13:28

I have dot connect for oracle professional 9.5.502.0, and dot connect for PostgreSQL professional 7.10.1134.0 installed.

I have a simple console app that includes this line:

public Devart.Common.DbConnectionBase DbConnection { get; set; }

If the project includes references to Devart.Data and Devart.Data.Oracle, then it builds fine.

However, when I add a reference to Devart.Data.PostgreSql, I get this compilation error:

The type 'DbConnectionBase' exists in both 'Devart.Data.Oracle, Version=9.5.502.0, Culture=neutral, PublicKeyToken=09af7300eec23701' and 'Devart.Data.PostgreSql, Version=7.10.1134.0, Culture=neutral, PublicKeyToken=09af7300eec23701'

Similarly, if I remove the Devart.Data.Oracle and include the Devart.Data.PostgreSql reference, it builds fine.

I am in the process of migrating from Oracle to PostgreSql, and would like to include BOTH references in the same project.

Am I doing something wrong?

Regards,

Bill Nichols.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Cannot reference Oracle AND PostgreSQL

Post by Pinturiccio » Fri 25 May 2018 16:31

This is the designed behaviour. The type Devart.Common.DbConnectionBase is declared in both assemblies: Devart.Data.Oracle.dll and Devart.Data.PostgreSql.dll. And your declaration is ambiguous. If you want work with both providers, you need to create two connections: OracleConnection and PgSqlConnection for each provider instead of DbConnectionBase.

You can also use dotConnect Universal and UniConnection instead of DbConnectionBase. For more information, please refer to https://www.devart.com/dotconnect/universal/docs/ . dotConnect Universal is intended for working with multiple data sources via common interface.

dotConnect Universal Professional Edition supports the runtime functionality of the Standard Edition of the dotConnect for Oracle, dotConnect for MySQL, dotConnect for SQLite and dotConnect for PostgreSQL data providers and allows using general ADO.NET functionality only. For more information, please refer to https://www.devart.com/dotconnect/unive ... iders.html

dotConnect for Oracle Professional Edition includes support for a set of advanced and Oracle-specific features, which are not available in dotConnect Universal. In particular, dotConnect for Oracle Professional Edition supports ORMs (Entity Framework and LinqConnect), whereas dotConnect Universal does not. The information about dotConnect for Oracle is also valid for dotConnect for PostgreSQL.

wdnichols
Posts: 9
Joined: Thu 24 May 2018 12:49

Re: Cannot reference Oracle AND PostgreSQL

Post by wdnichols » Tue 29 May 2018 19:24

I read through some of the literature on dotConnect Universal but could not find any mention of a loader.

We recently purchased dot connect for PostgreSQL professional (7.10.1134.0) and have been working its loader. If we were to switch to using dotConnect Universal to access our PostgreSQL data, does it have a loader that we can use?

Regards,

Bill Nichols.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Cannot reference Oracle AND PostgreSQL

Post by Pinturiccio » Wed 30 May 2018 15:46

PgSqlLoader class performs the COPY command of PostgreSQL server. It is a PostgreSQL-specific feature and dotConnect Universal does not have a loader, like dotConnect for PostgreSQL. The PgSqlLoader class significantly increases the performance of data insertion. dotConnect for Oracle has the OracleLoader class that also increases the performance of data insertion. If you want to use specific features of dotConnect for Oracle and dotConnect for PostgreSQL, then dotConnect Universal will not suit for your needs.

dotConnect Universal is intended for using a commopn interface to access different databases, and it supports only the features, available in all the providers.
dotConnect for Oracle and dotConnect for PostgreSQL can use source specific features, but each provider must use a specific connection, and a common interface cannot be used for working with multiple providers at the same time with one connection instance.

Post Reply