Dotmim.Sync icon indicating copy to clipboard operation
Dotmim.Sync copied to clipboard

Oracle Provider Implementation DONE

Open LGouellec opened this issue 5 years ago • 10 comments

LGouellec avatar Jul 31 '18 12:07 LGouellec

Thank you very much for your contribution! Before we pull this, could you spare some time to

  1. create some oracle integration test? you can use the chinook sample database because it exists for all databases (oracle, mssql, prostgre)

It would be great if we could strip our integrationtests and samples down to use the same database in the near future as I think this would greatly improve readability and overall clarity.

Is there any chance you could do that? :-)

gentledepp avatar Aug 14 '18 12:08 gentledepp

I am responsible for performing the Oracle integration test ASAP ;)

LGouellec avatar Aug 20 '18 12:08 LGouellec

Hello @LGouellec

Once again, thx a lot for your contribution, I really appreciate ! I've search an Oracle dev for so long time, it's amazing to see that the contribution comes from the community. thx !

For now, please don't work to hard on tests, since I'm working on a new way to implement the tests for each provider.

I will notify you when it will be available.

Can't wait to publish a new version of Dotmim.Sync with an Oracle provider !!

Mimetis avatar Aug 27 '18 14:08 Mimetis

Hello,

With pleasure, community is there for that :) ! To be honest, I had a need for Oracle database replication, and I saw your presentation at the latest Devoxx.

I also implemented the Bulk part on Oracle, but I have disabled it because the stored procedures are not as good as in SQL Server.

So I preferred to use the unitary part for now. I will try to do a little bit of unit testing on my part soon.

At your disposal for the rest of the events :)

LGouellec avatar Sep 03 '18 12:09 LGouellec

Hello @LGouellec

I spent a lot of time to implement a brand new test project, with a different approach.

You should look into it, it should be A LOT easier to implement the Oracle tests.

I wrote a Wiki on it. It's a work in progress, so let's continue the discussion here, and please let me know everything you did not understand, and I will update the wiki.

Unit tests project: How it works

Sebastien

Mimetis avatar Sep 07 '18 20:09 Mimetis

Wow - this looks cool! But as I am not so much a poweruser of XUnit, so please clarify this for me:

In your sample integration test Insert_One_Table_From_Server, you iterate over all syncconfigurations and call a base method to execute the tests. Are all those syncconfiguration + TCP/HTTP/xxx variations displayed as separate tests in Visual Studio Test explorer? (To mee it seems not to be the case, which would not be ideal :-|)

gentledepp avatar Sep 08 '18 07:09 gentledepp

You're right, One test could failed potentially for some reasons, bad SyncConfiguration, error on HTTP proxy and so on... and you won't have a clear message on it. To mitigate that, you can disable HTTP run in your provider fixture class.

For instance, the SqlServerFixture is running only on tcp with a sql client, on tcp with a mysql client and on http with sqlite (just an example) : Enable some properties on SqlServerFixture

public override bool EnableSqlServerClientOnTcp => true;
public override bool EnableSqlServerClientOnHttp => false;
public override bool EnableMySqlClientOnTcp => true;
public override bool EnableMySqlClientOnHttp => false;
public override bool EnableSqliteClientOnTcp => false;
public override bool EnableSqliteClientOnHttp => true;

Eventually my advice is to create your OracleFixture and enable only tcp on an Oracle client for example.

Something like that, I guess:

public class OracleFixture : ProviderFixture<CoreProvider>
{
    public override string DatabaseName => "OracleAdventureWorks";

    public override ProviderType ProviderType => ProviderType.Oracle;

    public override bool EnableOracleClientOnTcp => true;
    public override bool EnableOracleClientOnHttp => false;
    public override bool EnableSqlServerClientOnTcp => false;
    public override bool EnableSqlServerClientOnHttp => false;
    public override bool EnableMySqlClientOnTcp => false;
    public override bool EnableMySqlClientOnHttp => false;
    public override bool EnableSqliteClientOnTcp => false;
    public override bool EnableSqliteClientOnHttp => false;

    public OracleFixture()
    {
    }

    public override CoreProvider NewServerProvider(string connectionString)
    {
        return new OracleSyncProvider(connectionString);
    }
}

Mimetis avatar Sep 08 '18 12:09 Mimetis

Ok I see... this is not really optimal, but at least writing tests is way more efficient! 👍

gentledepp avatar Sep 08 '18 12:09 gentledepp

Hey @Mimetis, Is there any chance that this will be merged? 😅

yuecels avatar Oct 10 '22 18:10 yuecels

Hey @Mimetis, Is there any chance that this will be merged? 😅

No wayt, this PR is too old ;) But if you want to participate feel free to contribute

Mimetis avatar Oct 11 '22 20:10 Mimetis