Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle Provider Implementation DONE #68

Open
wants to merge 146 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
4ef83d2
Move folders Test and Samples.
Mimetis Aug 8, 2017
63f746f
Editing Readme
Mimetis Aug 8, 2017
91fcd8c
Adding VS 2017 image
Mimetis Aug 8, 2017
510ef40
add .sql file to be ignored
Mimetis Aug 8, 2017
e34b982
delete sql files
Mimetis Aug 8, 2017
4983ad4
Replacing Timestamp generation with SQLite expression "replace(strfti…
Mimetis Aug 9, 2017
7daef53
Resolving issue if a row is inserted and updated before a sync has oc…
Mimetis Aug 11, 2017
a2bbbf2
Playing with Errors on different SyncStage
Mimetis Aug 11, 2017
65a3628
Track SyncStage correctly
Mimetis Aug 11, 2017
5f60ac8
Resolving issue on GetRowState in CoreProvider
Mimetis Aug 11, 2017
331c4c8
migrate to netstandard 2.0 final version
tbolon Sep 2, 2017
bbcf200
Merge pull request #1 from tbolon/netstdfinal
Mimetis Sep 11, 2017
c46f817
Debuging SQLite for new metadata discovery
Mimetis Sep 14, 2017
f927d56
Set theme jekyll-theme-cayman
Mimetis Sep 16, 2017
6fc2b00
MySQL Provider, work on triggers & stored procedure
Mimetis Sep 18, 2017
18a9c52
Adding MySQL / MYSQL tests
Mimetis Oct 3, 2017
47d31ae
ok merge .netstandard 2.0
Mimetis Oct 3, 2017
b771558
Create Web proxy project, extract web features from Core project.
Mimetis Oct 6, 2017
1cafd2f
Move web project to correct folder
Mimetis Oct 6, 2017
75d7a8e
Move Web project to correct folder, 2nd Part
Mimetis Oct 6, 2017
8f31cc3
Allow byte as Auto Inc.
Mimetis Oct 7, 2017
e838eae
Allowing computed column to be null
Mimetis Oct 7, 2017
496e7d3
Check SqlMetadata if needed.
Mimetis Oct 7, 2017
97d2f93
Change Sql Server ExecuteBatchCommand to handle every kind of object …
Mimetis Oct 8, 2017
7f77fab
Add Project description
Mimetis Oct 8, 2017
c9cd254
editing readme.md
Mimetis Oct 8, 2017
d099802
readme.md TL;DR summary
Mimetis Oct 8, 2017
856407b
Add sql script for sample test
Mimetis Oct 8, 2017
f1a122b
correct url for AdvWorks
Mimetis Oct 8, 2017
8cf7bb5
Change tests to FX 4.7 to be able to test MySQL
Mimetis Oct 9, 2017
fa3271a
Fix spelling
jawn Oct 9, 2017
3ca25fe
Adding FX 4.6 Tests for MySql
Mimetis Oct 9, 2017
f51f715
Changing SyncConfiguration to be able to get DmTable Config during En…
Mimetis Oct 10, 2017
2878121
Adding Schema Option for Sql Server side
Mimetis Oct 10, 2017
9b8af51
Adding some tests to SQL Server and MySQL
Mimetis Oct 11, 2017
c6f36c1
add sql backup and mysql script
Mimetis Oct 11, 2017
0c01834
merge PR
Mimetis Oct 11, 2017
57c3a1f
Fix spelling
jawn Oct 11, 2017
5050352
Add SyncDirection : Bidirectionnal / UploadOnly / Downloadonly
Mimetis Oct 11, 2017
1cf8ca6
Merge remote-tracking branch 'jawn/patch-1'
Mimetis Oct 11, 2017
573084c
link to wiki
Mimetis Oct 11, 2017
0bbd4b0
Link to wiki, reformating introduction
Mimetis Oct 11, 2017
a1f266a
correct typo on sync_scope_id
Mimetis Oct 26, 2017
028a205
Adding console project. dotnet-sync is able to parse all arguments an…
Mimetis Nov 9, 2017
4f30f0a
Correction on reserved key words (Issue #15)
Mimetis Nov 12, 2017
a05a822
Adding tests for OneField table and correction on bug #18
Mimetis Nov 14, 2017
f591cfa
Correction on bug #19 causing first insert from one client, not repli…
Mimetis Nov 14, 2017
0574ffb
Adding tests for multiples clients through http.
Mimetis Nov 15, 2017
5d10a30
Adding tests for multiples clients
Mimetis Nov 15, 2017
47cdc77
Correction for issue #19 and #17
Mimetis Nov 15, 2017
7ffdc57
Add one more client for testing 3 clients
Mimetis Nov 15, 2017
2a0fffc
adding web option to CLI
Mimetis Nov 16, 2017
c89be8a
correction on urls
Mimetis Nov 16, 2017
75b9b43
Switching from System.Dat.SQLite to Microsoft.Data.Sqlite
Mimetis Nov 17, 2017
c7c44ec
Version 0.1.5
Mimetis Nov 17, 2017
a379992
Adding connection builders to all providers
Mimetis Nov 20, 2017
2117d8a
Changing SqlMetadata constructor behavior for handling VarBinary Corr…
Mimetis Nov 22, 2017
f2d7487
Changing MySql Driver from Official MySql.Data to MySqlConnector, whi…
Mimetis Nov 23, 2017
20b96e7
In some circumstances, we could have a last batch without any data (j…
Mimetis Nov 23, 2017
6474cd7
Adding wordpress test backup
Mimetis Nov 25, 2017
c59f099
Correcting bugs on MySql provider : Stored procedures, correct flag (…
Mimetis Nov 25, 2017
bcae06d
Adding MySql tests in the .Net Core Tests
Mimetis Nov 25, 2017
8e3830f
Changing SelectChanges stored procedures
Mimetis Nov 26, 2017
5ba275c
Resolving a conflict on determinating if a row is deleted after a con…
Mimetis Nov 27, 2017
09e69a4
Update UWP sample
Mimetis Nov 27, 2017
dfd4efa
Removing DbOption, since it's never used
Mimetis Nov 27, 2017
8be8c72
Implementing new feature : Reinitialize and ReinitializeWithUpload
Mimetis Nov 27, 2017
851e6ab
Removing Logger since it's not used.
Mimetis Nov 27, 2017
239219f
Fixing sting fixed length
Mimetis Nov 29, 2017
0e723aa
Adding the Merge option to be able to merge a conflict row
Mimetis Nov 30, 2017
8dc0fa4
Updating CLI and creating the docs folder
Mimetis Dec 1, 2017
96fd110
upload docs
Mimetis Dec 1, 2017
8396ce7
Set theme jekyll-theme-dinky
Mimetis Dec 1, 2017
a245b3b
Set theme jekyll-theme-cayman
Mimetis Dec 1, 2017
b067170
Home webpage
Mimetis Dec 1, 2017
13881e1
Merge branch 'master' of https://github.com/Mimetis/Dotmim.Sync
Mimetis Dec 1, 2017
dd4fba3
Readme
Mimetis Dec 1, 2017
f4e8275
d
Mimetis Dec 1, 2017
3a1ecea
d
Mimetis Dec 1, 2017
245ab5d
Set theme jekyll-theme-cayman
Mimetis Dec 1, 2017
bc3d5be
using jekyll
Mimetis Dec 1, 2017
cde5590
Set theme jekyll-theme-midnight
Mimetis Dec 2, 2017
fa9acb7
docs
Mimetis Dec 2, 2017
04e78ee
config.yml
Mimetis Dec 2, 2017
51f63b6
yml
Mimetis Dec 2, 2017
67e9daf
yml
Mimetis Dec 2, 2017
808fd68
yml
Mimetis Dec 2, 2017
7299c35
readme
Mimetis Dec 2, 2017
c1d4f0d
Set theme jekyll-theme-midnight
Mimetis Dec 2, 2017
a4d1d1a
Set theme jekyll-theme-architect
Mimetis Dec 2, 2017
50f5b73
docs2
Mimetis Dec 2, 2017
df12d31
new docs
Mimetis Dec 2, 2017
a01801c
readme
Mimetis Dec 2, 2017
c9471bf
all docs files
Mimetis Dec 2, 2017
200b845
Set theme jekyll-theme-midnight
Mimetis Dec 2, 2017
26031a0
edit sass
Mimetis Dec 2, 2017
4943a2a
edit sass
Mimetis Dec 2, 2017
e4f8bef
enable csharp code formatting
Mimetis Dec 2, 2017
647542e
adding summary md
Mimetis Dec 2, 2017
c53cf29
doc
Mimetis Dec 2, 2017
2061cd5
cs
Mimetis Dec 2, 2017
bafabe5
remove
Mimetis Dec 2, 2017
f024183
s
Mimetis Dec 2, 2017
cb409f4
d
Mimetis Dec 2, 2017
14c8ca0
default
Mimetis Dec 2, 2017
e61c954
layout
Mimetis Dec 2, 2017
32083c3
layout
Mimetis Dec 2, 2017
9fe15b2
title css
Mimetis Dec 2, 2017
36a1f2d
update docs
Mimetis Dec 3, 2017
10d6d9e
conflict
Mimetis Dec 3, 2017
4604337
links
Mimetis Dec 3, 2017
9e3f651
summary
Mimetis Dec 3, 2017
cb9e181
summary
Mimetis Dec 3, 2017
196c72a
link
Mimetis Dec 3, 2017
e49d6ca
Correction on conflict resolution on multiples clients. Resolving #31
Mimetis Dec 4, 2017
6b9238d
editing readme
Mimetis Dec 4, 2017
040cae8
update readme
Mimetis Dec 4, 2017
7f2e410
Tag version 0.1.7.0
Mimetis Dec 4, 2017
64b712c
Resolve some perf issue and memory leaks.
Mimetis Dec 17, 2017
4ff852e
minor corrections to pass tests !
Mimetis Dec 19, 2017
821c802
Resolving some minor memory leaks
Mimetis Dec 21, 2017
17eeb16
mark as 0.1.8
Mimetis Dec 21, 2017
4267e9d
Add Sync Progress Docs.
Mimetis Dec 22, 2017
7d3d527
Adding docs on provision / deprovisioning
Mimetis Dec 23, 2017
c3ce70f
typo corrections
Mimetis Dec 23, 2017
c62313b
theming
Mimetis Dec 23, 2017
9800538
d
Mimetis Dec 23, 2017
10e688d
css
Mimetis Dec 23, 2017
7a80066
update css
Mimetis Dec 23, 2017
20759a1
update css
Mimetis Dec 23, 2017
95da5a4
update css
Mimetis Dec 23, 2017
cafd304
Add synchronize doc
Mimetis Dec 27, 2017
00f79a9
minor changes for sample, requested by issue #35
Mimetis Dec 27, 2017
6eb537f
Bug on Reinitialize when multiples tables are involved.
Mimetis Dec 27, 2017
c87026a
first part to implement a better way to throw exception
Mimetis Jan 17, 2018
a5abacb
add docs on existings tables
Mimetis Jan 17, 2018
635ff5f
Add deprovision for ScopeInfo and tests about that
Mimetis Jan 19, 2018
b739294
add the authentication process, and sample
Mimetis Feb 13, 2018
ee524d0
version 0.1.9
Mimetis Feb 14, 2018
ee27869
Resolve bugs on batch and conflict.
Mimetis Apr 18, 2018
59f06ea
Oracle Provider : IN PROGRESS
LGouellec May 29, 2018
53bef02
change arbo folder
LGouellec May 29, 2018
c1f6534
Provider Oracle IN PROGRESS
LGouellec Jun 7, 2018
7886d9c
Provider Oracle IN PROGRESS
LGouellec Jul 17, 2018
a40aac5
Oracle Provider Simply implementation DONE
LGouellec Jul 25, 2018
03cdfc1
Oracle Bulk Operation DONE
LGouellec Jul 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,7 @@ paket-files/

# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
*.pyc

# SQL
*.sql
Binary file added Assets/VS2017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CreateAdventureWorks.sql
Binary file not shown.
31 changes: 0 additions & 31 deletions DeleteAllTablesAndStoredProcAndTypes.sql

This file was deleted.

219 changes: 201 additions & 18 deletions Dotmim.Sync.sln

Large diffs are not rendered by default.

Binary file removed Fabrikam Delete.sql
Binary file not shown.
Binary file removed Fabrikam.sql
Binary file not shown.
28 changes: 0 additions & 28 deletions FabrikamStart.sql

This file was deleted.

Binary file removed FabrikamTimestampAndScopes.sql
Binary file not shown.
11 changes: 0 additions & 11 deletions Insert 5000 servicetickets.sql

This file was deleted.

29 changes: 24 additions & 5 deletions Projects/Dotmim.Sync.Core/Batch/BatchInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
using System.Linq;
using System.Text;

namespace Dotmim.Sync.Core.Batch
namespace Dotmim.Sync.Batch
{
/// <summary>
/// Represents a Batch, containing a full or serialized change set
/// </summary>
[Serializable]
public class BatchInfo
{

Expand Down Expand Up @@ -74,6 +75,7 @@ public IEnumerable<DmTable> GetTable(string tableName)
if (batchPartinInfo.Set.Tables.Contains(tableName))
{
yield return batchPartinInfo.Set.Tables[tableName];

if (isSerialized)
{
batchPartinInfo.Set.Clear();
Expand All @@ -98,8 +100,9 @@ internal BatchPartInfo GenerateBatchInfo(int batchIndex, DmSet changesSet, strin
else
hasData = changesSet.Tables.Any(t => t.Rows.Count > 0);

if (!hasData)
return null;
// Sometimes we can have a last BPI without any data, but we need to generate it to be able to have the IsLast batch property
//if (!hasData)
// return null;

BatchPartInfo bpi = null;
// Create a batch part
Expand All @@ -123,12 +126,17 @@ internal BatchPartInfo GenerateBatchInfo(int batchIndex, DmSet changesSet, strin
}


internal static string GenerateNewDirectoryName()
public static string GenerateNewDirectoryName()
{
return String.Concat(DateTime.UtcNow.ToString("yyyy_MM_dd_ss"), Path.GetRandomFileName().Replace(".", ""));
}

internal static string GenerateNewFileName(string batchIndex)
/// <summary>
/// generate a batch file name
/// </summary>
/// <param name="batchIndex"></param>
/// <returns></returns>
public static string GenerateNewFileName(string batchIndex)
{
if (batchIndex.Length == 1)
batchIndex = $"00{batchIndex}";
Expand All @@ -142,5 +150,16 @@ internal static string GenerateNewFileName(string batchIndex)
return $"{batchIndex}_{Path.GetRandomFileName().Replace(".", "_")}.batch";
}


public void Clear()
{
foreach (var bpi in this.BatchPartsInfo)
{
bpi.Clear();
}

this.BatchPartsInfo.Clear();

}
}
}
24 changes: 11 additions & 13 deletions Projects/Dotmim.Sync.Core/Batch/BatchPart.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
using DmBinaryFormatter;
using Dotmim.Sync.Data;
using Dotmim.Sync.Data.Surrogate;
using Dotmim.Sync.Data.Surrogate;
using Dotmim.Sync.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Runtime.Serialization.Formatters.Binary;

namespace Dotmim.Sync.Core.Batch
namespace Dotmim.Sync.Batch
{
/// <summary>
/// Batch Part
/// FullName like : [Guid].batch
/// </summary>
[Serializable]
public class BatchPart
{
/// <summary>
Expand All @@ -22,18 +21,17 @@ public class BatchPart
public static BatchPart Deserialize(string fileName)
{
if (String.IsNullOrEmpty(fileName))
throw new ArgumentException("Cant get a Batch part if fileName doesn't exist");
throw new ArgumentNullException("Cant get a Batch part if fileName doesn't exist");

if (!File.Exists(fileName))
throw new ArgumentException($"file {fileName} doesn't exist");
throw new ArgumentNullException($"file {fileName} doesn't exist");

BatchPart bp = new BatchPart();

//TODO : Should we use the serializer from the user ?
using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
{
DmSerializer serializer = new DmSerializer();
bp.DmSetSurrogate = serializer.Deserialize<DmSetSurrogate>(fs);
BinaryFormatter serializer = new BinaryFormatter();
bp.DmSetSurrogate = serializer.Deserialize(fs) as DmSetSurrogate;
}

return bp;
Expand All @@ -42,7 +40,6 @@ public static BatchPart Deserialize(string fileName)

public static void Serialize(DmSetSurrogate set, string fileName)
{
DmSerializer serializer = new DmSerializer();

FileInfo fi = new FileInfo(fileName);

Expand All @@ -52,7 +49,8 @@ public static void Serialize(DmSetSurrogate set, string fileName)
// Serialize on disk.
using (var f = new FileStream(fileName, FileMode.CreateNew, FileAccess.ReadWrite))
{
serializer.Serialize(set, f);
BinaryFormatter serializer = new BinaryFormatter();
serializer.Serialize(f, set);
}
}

Expand Down
71 changes: 25 additions & 46 deletions Projects/Dotmim.Sync.Core/Batch/BatchPartInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
using System.Linq;
using System.Text;

namespace Dotmim.Sync.Core.Batch
namespace Dotmim.Sync.Batch
{
/// <summary>
/// Info about a BatchPart
/// Will be serialized in the BatchInfo file
/// </summary>
[Serializable]
public class BatchPartInfo
{
private BatchPart batch;
Expand All @@ -24,7 +25,7 @@ public BatchPart GetBatch()
return batch;

if (String.IsNullOrEmpty(this.FileName))
throw new ArgumentException("Cant get a batchpart if filename is null");
throw new ArgumentNullException("Cant get a batchpart if filename is null");

// Get a Batch part, and deserialise the file into a DmSetSurrogate
batch = BatchPart.Deserialize(this.FileName);
Expand Down Expand Up @@ -63,10 +64,23 @@ public void Clear()
/// <summary>
/// Gets or Sets the DmSet from the batch associated once the DmSetSurrogate is deserialized
/// </summary>
public DmSet Set { get; set; }

[NonSerialized]
private DmSet set;
public DmSet Set
{
get
{
return set;
}
set
{
set = value;
}
}


internal BatchPartInfo()
public BatchPartInfo()
{
}

Expand All @@ -83,10 +97,12 @@ public static BatchPartInfo DeserializeFromDmSet(DmSet set)

var dmRow = set.Tables["DotmimSync__BatchPartsInfo"].Rows[0];

var bpi = new BatchPartInfo();
bpi.Index = (int)dmRow["Index"];
bpi.FileName = dmRow["FileName"] as string;
bpi.IsLastBatch = (Boolean)dmRow["IsLastBatch"];
var bpi = new BatchPartInfo
{
Index = (int)dmRow["Index"],
FileName = dmRow["FileName"] as string,
IsLastBatch = (Boolean)dmRow["IsLastBatch"]
};

if (dmRow["Tables"] != null)
{
Expand All @@ -98,44 +114,7 @@ public static BatchPartInfo DeserializeFromDmSet(DmSet set)
return bpi;
}

/// <summary>
/// Serialize the BatchPartInfo WITHOUT the DmSet
/// </summary>
internal static void SerializeInDmSet(DmSet set, BatchPartInfo bpi)
{
if (set == null)
return;

DmTable dmTableBatchPartsInfo = null;

if (!set.Tables.Contains("DotmimSync__BatchPartsInfo"))
{
dmTableBatchPartsInfo = new DmTable("DotmimSync__BatchPartsInfo");
set.Tables.Add(dmTableBatchPartsInfo);
}

dmTableBatchPartsInfo = set.Tables["DotmimSync__BatchPartsInfo"];

dmTableBatchPartsInfo.Columns.Add<String>("FileName");
dmTableBatchPartsInfo.Columns.Add<int>("Index");
dmTableBatchPartsInfo.Columns.Add<Boolean>("IsLastBatch");
dmTableBatchPartsInfo.Columns.Add<String>("Tables");

var dmRow = dmTableBatchPartsInfo.NewRow();
dmRow["FileName"] = bpi.FileName;
dmRow["Index"] = bpi.Index;
dmRow["IsLastBatch"] = bpi.IsLastBatch;

if (bpi.Tables != null && bpi.Tables.Length > 0)
{
var tablesString = String.Join("|", bpi.Tables);
dmRow["Tables"] = tablesString;
}

dmTableBatchPartsInfo.Rows.Add(dmRow);

}


/// <summary>
/// Create a new BPI, and serialize the changeset if not in memory
/// </summary>
Expand Down
14 changes: 14 additions & 0 deletions Projects/Dotmim.Sync.Core/Batch/BatchType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Dotmim.Sync.Batch
{
public enum BatchType
{
InMemory,
Files,
Archive

}
}
Loading