Skip to content

Commit

Permalink
Fixing nested Transaction bug with Sqlite.
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrypt authored and sebastienros committed May 10, 2016
1 parent d96ef16 commit 54aac0d
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 42 deletions.
45 changes: 45 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,45 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (Samples.Hi)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Dotnet Build Debug",
"program": "${workspaceRoot}/samples/YesSql.Samples.Hi/bin/Debug/netstandardapp1.5/win7-x64/YesSql.Samples.Hi.exe",
"args": [],
"cwd": "${workspaceRoot}/samples/YesSql.Samples.Hi",
"stopAtEntry": false
},
{
"name": ".NET Core Launch (Samples.Performance)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Dotnet Build Debug",
"program": "${workspaceRoot}/samples/YesSql.Samples.Performance/bin/Debug/netstandardapp1.5/win7-x64/YesSql.Samples.Performance.exe",
"args": [],
"cwd": "${workspaceRoot}/samples/YesSql.Samples.Performance",
"stopAtEntry": false
},
{
"name": ".NET Core Launch (Samples.FullText)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Dotnet Build Debug",
"program": "${workspaceRoot}/samples/YesSql.Samples.FullText/bin/Debug/netstandardapp1.5/win7-x64/YesSql.Samples.FullText.exe",
"args": [],
"cwd": "${workspaceRoot}/samples/YesSql.Samples.FullText",
"stopAtEntry": false
},
{
"name": ".NET Core Launch (Samples.Bench)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "Dotnet Build Debug",
"program": "${workspaceRoot}/samples/YesSql.Bench/bin/Debug/netstandardapp1.5/win7-x64/YesSql.Bench.exe",
"args": [],
"cwd": "${workspaceRoot}/samples/YesSql.Bench",
"stopAtEntry": false
}
]
}
44 changes: 44 additions & 0 deletions .vscode/tasks.json
@@ -0,0 +1,44 @@
{
"version": "0.1.0",
"linux": { "command": "sh", "args": ["-c"] },
"osx": { "command": "sh", "args": ["-c"] },
"windows": { "command": "cmd", "args": ["/C"] },
"isShellCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"tasks": [
{
"taskName": "Dotnet Restore",
"args": [ "dotnet restore" ]
},
{
"taskName": "Dotnet Force Restore",
"args": [ "dotnet restore --no-cache" ]
},
{
"taskName": "Dotnet Rebuild Debug",
"args": [ "dotnet build ${workspaceRoot}/samples/YesSql.Samples.Hi --no-incremental -c Debug" ],
"problemMatcher": "$msCompile"
},
{
"taskName": "Dotnet Build Debug",
"args": [ "dotnet build ${workspaceRoot}/samples/YesSql.Samples.Hi -c Debug" ],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
},
{
"taskName": "Dotnet Build Release",
"args": [ "dotnet build ${workspaceRoot}/samples/YesSql.Samples.Hi -c Release" ],
"problemMatcher": "$msCompile"
},
{
"taskName": "Dotnet Run",
"args": [ "cd ${workspaceRoot}/samples/YesSql.Samples.Hi & dotnet run" ]
},
{
"taskName": "Gulp Build",
"args": [ "gulp build" ],
"problemMatcher": "$gulp-tsc"
}
]
}
7 changes: 6 additions & 1 deletion samples/YesSql.Bench/project.json
@@ -1,11 +1,16 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.Data.Sqlite": "1.0.0-*",
"Microsoft.Data.Sqlite": "1.0.0-rc2-20809",
"YesSql.Core": "2.0.0-*",
"YesSql.Storage.LightningDB": "1.0.0-*",
"xunit": "2.1.0"
},
"buildOptions": {
"emitEntryPoint": true,
"debugType": "portable",
"preserveCompilationContext": true
},
"commands": {
"YesSql.Bench": "YesSql.Bench"
},
Expand Down
7 changes: 6 additions & 1 deletion samples/YesSql.Samples.FullText/project.json
@@ -1,11 +1,16 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.Data.Sqlite": "1.0.0-rc2-20451",
"Microsoft.Data.Sqlite": "1.0.0-rc2-20809",
"YesSql.Core": "2.0.0-*",
"YesSql.Storage.InMemory": "1.0.0-*",
"xunit": "2.1.0"
},
"buildOptions": {
"emitEntryPoint": true,
"debugType": "portable",
"preserveCompilationContext": true
},
"commands": {
"YesSql.Samples.Performance": "YesSql.Samples.Performance"
},
Expand Down
4 changes: 3 additions & 1 deletion samples/YesSql.Samples.Hi/Program.cs
@@ -1,5 +1,6 @@
using System;
using Microsoft.Data.Sqlite;
using System.Data;
using YesSql.Core.Services;
using YesSql.Samples.Hi.Indexes;
using YesSql.Samples.Hi.Models;
Expand All @@ -13,8 +14,9 @@ private static void Main()
{
var store = new Store(cfg =>
{
cfg.ConnectionFactory = new DbConnectionFactory<SqliteConnection>(@"Data Source=:memory:", true);
cfg.ConnectionFactory = new DbConnectionFactory<SqliteConnection>(@"Data Source=" + System.IO.Directory.GetCurrentDirectory() + @"\bin\Debug\yessql.db;Cache=Shared", true);
cfg.DocumentStorageFactory = new InMemoryDocumentStorageFactory();
cfg.IsolationLevel = IsolationLevel.Serializable;
});

store.InitializeAsync().Wait();
Expand Down
7 changes: 6 additions & 1 deletion samples/YesSql.Samples.Hi/project.json
@@ -1,11 +1,16 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.Data.Sqlite": "1.0.0-rc2-20451",
"Microsoft.Data.Sqlite": "1.0.0-rc2-20809",
"YesSql.Core": "2.0.0-*",
"YesSql.Storage.InMemory": "1.0.0-*",
"xunit": "2.1.0"
},
"buildOptions": {
"emitEntryPoint": true,
"debugType": "portable",
"preserveCompilationContext": true
},
"commands": {
"YesSql.Samples.Performance": "YesSql.Samples.Performance"
},
Expand Down
2 changes: 1 addition & 1 deletion samples/YesSql.Samples.Performance/Program.cs
Expand Up @@ -478,7 +478,7 @@ public class Program
};
#endregion

public void Main()
public static void Main()
{
StoreUsers(new InMemoryDocumentStorageFactory()).Wait();

Expand Down
7 changes: 6 additions & 1 deletion samples/YesSql.Samples.Performance/project.json
@@ -1,13 +1,18 @@
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.Data.Sqlite": "1.0.0-rc2-20451",
"Microsoft.Data.Sqlite": "1.0.0-rc2-20809",
"YesSql.Core": "2.0.0-*",
"YesSql.Storage.InMemory": "1.0.0-*",
"YesSql.Storage.LightningDB": "1.0.0-*",
"YesSql.Storage.Sql": "1.0.0-*",
"xunit": "2.1.0"
},
"buildOptions": {
"emitEntryPoint": true,
"debugType": "portable",
"preserveCompilationContext": true
},
"commands": {
"YesSql.Samples.Performance": "YesSql.Samples.Performance"
},
Expand Down
2 changes: 0 additions & 2 deletions src/YesSql.Core/Services/Session.cs
Expand Up @@ -336,8 +336,6 @@ public async Task CommitAsync(bool keepTracked = false)
return;
}

Demand();

// saving all updated entities
foreach (var obj in _updated)
{
Expand Down
29 changes: 17 additions & 12 deletions src/YesSql.Core/project.json
Expand Up @@ -2,8 +2,13 @@
"version": "2.0.0-alpha-9027",
"authors": [ "Sebastien Ros" ],
"copyright": "Sebastien Ros",
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt",
"packOptions": {
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt"
},
"buildOptions": {
"debugType": "portable"
},
"dependencies": {
"Newtonsoft.Json": "8.0.3",
"Dapper": "1.50.0-beta9"
Expand All @@ -19,20 +24,20 @@
"NETStandard.Library": "1.5.0-*",

"Microsoft.CSharp": "4.0.1-rc2-23931",
"System.Collections": "4.0.11-rc2-23931",
"System.Collections.Concurrent": "4.0.12-rc2-23931",
"System.Collections.NonGeneric": "4.0.1-rc2-23931",
"System.Collections": "4.0.11-rc2-24027",
"System.Collections.Concurrent": "4.0.12-rc2-24027",
"System.Collections.NonGeneric": "4.0.1-rc2-24027",
"System.Data.SqlClient": "4.1.0-rc2-23931",
"System.Linq": "4.1.0-rc2-23931",
"System.Linq": "4.1.0-rc2-24027",
"System.Reflection.Emit.ILGeneration": "4.0.1-rc2-23931",
"System.Reflection.Emit.Lightweight": "4.0.1-rc2-23931",
"System.Reflection.TypeExtensions": "4.1.0-rc2-23931",
"System.Runtime": "4.1.0-rc2-23931",
"System.Text.RegularExpressions": "4.0.12-rc2-23931",
"System.Threading": "4.0.11-rc2-23931",
"System.Threading.ThreadPool": "4.0.10-rc2-23931",
"System.Xml.XDocument": "4.0.11-rc2-23931",
"System.Xml.XmlDocument": "4.0.1-rc2-23931"
"System.Runtime": "4.1.0-rc2-24027",
"System.Text.RegularExpressions": "4.0.12-rc2-24027",
"System.Threading": "4.0.11-rc2-24027",
"System.Threading.ThreadPool": "4.0.10-rc2-24027",
"System.Xml.XDocument": "4.0.11-rc2-24027",
"System.Xml.XmlDocument": "4.0.1-rc2-24027"
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/YesSql.Storage.Cache/project.json
Expand Up @@ -2,8 +2,10 @@
"version": "1.0.0-alpha-1006",
"authors": [ "Sebastien Ros" ],
"copyright": "Sebastien Ros",
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt",
"packOptions": {
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt"
},
"dependencies": {
"YesSql.Core": "2.0.0-*"
},
Expand Down
12 changes: 9 additions & 3 deletions src/YesSql.Storage.InMemory/project.json
Expand Up @@ -2,8 +2,13 @@
"version": "1.0.0-alpha-1008",
"authors": [ "Sebastien Ros" ],
"copyright": "Sebastien Ros",
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt",
"packOptions": {
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt"
},
"buildOptions": {
"debugType": "portable"
},
"dependencies": {
"YesSql.Core": "2.0.0-*"
},
Expand All @@ -15,7 +20,8 @@
"portable-net451+win8"
],
"dependencies": {
"NETStandard.Library": "1.5.0-*"
"NETStandard.Library": "1.5.0-*",
"System.Runtime.Serialization.Primitives": "4.0.10"
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/YesSql.Storage.LightningDB/project.json
Expand Up @@ -2,8 +2,10 @@
"version": "1.0.0-alpha-1010",
"authors": [ "Sebastien Ros" ],
"copyright": "Sebastien Ros",
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt",
"packOptions": {
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt"
},
"dependencies": {
"YesSql.Core": "2.0.0-*",
"LightningDB": "0.9.3-rc1-45"
Expand Down
6 changes: 4 additions & 2 deletions src/YesSql.Storage.Sql/project.json
Expand Up @@ -2,8 +2,10 @@
"version": "1.0.0-alpha-1013",
"authors": [ "Sebastien Ros" ],
"copyright": "Sebastien Ros",
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt",
"packOptions": {
"projectUrl": "https://github.com/sebastienros/yessql/blob/dnx",
"licenseUrl": "https://github.com/sebastienros/yessql/blob/dnx/LICENSE.txt"
},
"dependencies": {
"YesSql.Core": "2.0.0-*"
},
Expand Down
16 changes: 3 additions & 13 deletions test/YesSql.Tests/project.json
Expand Up @@ -18,19 +18,9 @@
],
"dependencies": {
"NETStandard.Library": "1.5.0-*",
"dotnet-test-xunit": "1.0.0-dev-*",
"System.Reflection.Extensions": "4.0.1-rc2-23931",
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-23931"
}
},
"net451": {
"frameworkAssemblies": {
"System.Runtime": {
"type": "build"
},
"System.Runtime.Serialization": "4.0.0.0"
},
"dependencies": {
"dotnet-test-xunit": "1.0.0-rc2-*",
"System.Reflection.Extensions": "4.0.1-rc2-24027",
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24027"
}
}
}
Expand Down

0 comments on commit 54aac0d

Please sign in to comment.