Skip to content

Commit 973ee89

Browse files
committed
feat: Add Oracle Database support with CI configuration and tests
1 parent 7b981d5 commit 973ee89

16 files changed

Lines changed: 194 additions & 112 deletions

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
- postgresql
8282
- mysql
8383
- sqlite
84+
- oracle
8485

8586
services:
8687
postgresql:
@@ -109,11 +110,25 @@ jobs:
109110
--health-retries 5
110111
ports:
111112
- 3306:3306
113+
114+
oracle:
115+
image: gvenzl/oracle-xe:latest
116+
env:
117+
ORACLE_ALLOW_REMOTE: true
118+
ORACLE_PASSWORD: Password12!
119+
options: >-
120+
--health-cmd "sqlplus -L -S / as sysdba @/dev/null"
121+
--health-interval 15s
122+
--health-timeout 10s
123+
--health-retries 10
124+
ports:
125+
- 1521:1521
112126

113127
env:
114128
NEventStore.PostgreSql: Server=localhost;Database=NEventStore;Uid=postgres;Pwd=Password12!;Enlist=false;
115129
NEventStore.MySql: Server=localhost;Database=NEventStore;Uid=root;Pwd=Password12!;AutoEnlist=false;
116130
NEventStore.Sqlite: Data Source=:memory:;Cache=Shared;
131+
NEventStore.Oracle: Data Source=localhost:1521/XE;User Id=system;Password=Password12!;Persist Security Info=True;
117132

118133
steps:
119134
- name: Checkout

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
- Added explicit support for net8.0,net9.0,net10.0
66
- Updated NEventStore 10.2.0
77
- Updated Microsoft.Data.SqlClient 7.0.1
8+
- Updated Oracle.ManagedDataAccess 23.26.200
9+
- Fixed Oracle Database connector.
10+
- added tests and CI support for Oracle Database (using Oracle XE in docker)
11+
- Research and enable Oracle integration test infrastructure [#58](https://github.com/NEventStore/NEventStore.Persistence.SQL/issues/58)
812

913
### Breaking Changes
1014

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ NEventStore.Persistence.Sql currently supports:
1414
- SqlLite
1515
- MySql
1616
- PostgreSQL
17-
- Oracle (not tested)
17+
- Oracle
1818

1919
Build Status
2020
===
@@ -66,7 +66,7 @@ To build the project locally on a Windows Machine:
6666
NEventStore.MsSql="Server=localhost,50001;Database=NEventStore;User Id=sa;Password=Password1;TrustServerCertificate=True;"
6767
NEventStore.MySql="Server=localhost;Port=50003;Database=NEventStore;Uid=sa;Pwd=Password1;AutoEnlist=false;"
6868
NEventStore.PostgreSql="Server=localhost;Port=50004;Database=NEventStore;Uid=sa;Pwd=Password1;Enlist=false;"
69-
NEventStore.Oracle="Data Source=localhost:1521/XE;User Id=system;Password=Password1;Persist Security Info=True;"
69+
NEventStore.Oracle="Data Source=localhost:50005/XE;User Id=system;Password=Password1;Persist Security Info=True;"
7070
```
7171

7272
## How to contribute
@@ -122,4 +122,4 @@ This means, that we need a NEventStore greater than the latest published, but le
122122
5.4.0
123123
5.4.1
124124
6.0.0-unstable00001
125-
6.0.0
125+
6.0.0

docker/Readme.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,4 @@ NEventStore.MsSql="Server=localhost,50001;Database=NEventStore;User Id=sa;Passwo
1515
NEventStore.MongoDB="mongodb://localhost:50002/NEventStore"
1616
NEventStore.MySql="Server=localhost;Port=50003;Database=NEventStore;Uid=sa;Pwd=Password1;AutoEnlist=false;"
1717
NEventStore.PostgreSql="Server=localhost;Port=50004;Database=NEventStore;Uid=sa;Pwd=Password1;Enlist=false;"
18-
19-
## To be tested
20-
21-
NEventStore.Oracle="Data Source=[host]:1521/XE;User Id=system;Password=NEventStore;Persist Security Info=True;"
18+
NEventStore.Oracle="Data Source=localhost:50005/XE;User Id=system;Password=Password1;Persist Security Info=True;"

docker/docker-compose.ci.linux.db.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ services:
5353
ports:
5454
- "50004:5432"
5555

56+
oracle:
57+
container_name: nesci-oracle-1
58+
platform: linux
59+
image: gvenzl/oracle-xe
60+
restart: always
61+
environment:
62+
- ORACLE_ALLOW_REMOTE=true
63+
- ORACLE_PASSWORD=Password1
64+
ports:
65+
- "50005:1521"
66+
5667
#volumes:
5768
# nes_sqldata_linux_ci:
5869
# nes_mongodata_linux_ci:

docker/docker-compose.ci.windows.db.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@ services:
5353
ports:
5454
- "50004:5432"
5555

56+
oracle:
57+
container_name: nesci-oracle-1
58+
platform: linux
59+
image: gvenzl/oracle-xe:23
60+
restart: always
61+
environment:
62+
- ORACLE_ALLOW_REMOTE=true
63+
- ORACLE_PASSWORD=Password1
64+
ports:
65+
- "50005:1521"
66+
5667
#volumes:
5768
# nes_sqldata_windows_ci:
5869
# nes_sqllog_windows_ci:

docs/Project-Analysis-Issue-Drafts.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,26 @@ For implementation issues created from this document:
234234
3. Run `dotnet build ./src/NEventStore.Persistence.Sql.Core.sln -c Release --no-restore /p:ContinuousIntegrationBuild=true`.
235235
4. Run `dotnet test ./src/NEventStore.Persistence.Sql.Core.sln -c Release --no-build` when DB prerequisites are available.
236236

237+
## Handoff Notes
238+
239+
### Issue #58: Oracle Support And Tests
240+
241+
Status: completed on 2026-06-11.
242+
243+
Oracle support and tests are back. The Oracle Docker setup was validated with the `gvenzl/oracle-xe` container exposed on `localhost:50005`, using:
244+
245+
```text
246+
NEventStore.Oracle="Data Source=localhost:50005/XE;User Id=system;Password=Password1;Persist Security Info=True;"
247+
```
248+
249+
Implementation notes:
250+
251+
- Modern .NET Oracle tests use `Oracle.ManagedDataAccess.Core`; `net472` keeps `Oracle.ManagedDataAccess`.
252+
- Oracle payload binding now uses the active `OracleConnection` directly.
253+
- Oracle parameter binding avoids unsupported provider `DbType` assignments and uses `DbType.DateTime` instead of `DbType.DateTime2`.
254+
- Oracle snapshot candidate paging was fixed so `GetStreamsToSnapshot` behaves like the other providers.
255+
256+
Validation:
257+
258+
- `dotnet test .\src\NEventStore.Persistence.Oracle.Tests\NEventStore.Persistence.Oracle.Core.Tests.csproj -c Release --no-build -f net8.0`
259+
- Result: 137 passed, 0 failed, 0 skipped.

src/NEventStore.Persistence.Oracle.Tests/NEventStore.Persistence.Oracle.Core.Tests.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
<DefineConstants Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">NUNIT</DefineConstants>
1414
</PropertyGroup>
1515

16-
<ItemGroup>
16+
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
1717
<PackageReference Include="Oracle.ManagedDataAccess" Version="23.26.200" />
1818
</ItemGroup>
19+
<ItemGroup Condition="'$(TargetFramework)' != 'net472'">
20+
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.26.0" />
21+
</ItemGroup>
1922
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
2023
<Reference Include="System.Data" />
2124
<Reference Include="System.Transactions" />

src/NEventStore.Persistence.Oracle.Tests/app.config

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<configuration>
33
<configSections>
44
<section name="oracle.manageddataaccess.client"
5-
type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
5+
type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess"/>
66
</configSections>
77
<system.data>
88
<DbProviderFactories>
@@ -11,21 +11,12 @@
1111
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess"/>
1212
<remove invariant="Oracle.ManagedDataAccess.Client"/>
1313
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
14-
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
14+
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess"/>
1515
</DbProviderFactories>
1616
</system.data>
1717
<startup>
1818
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
1919
</startup>
20-
<runtime>
21-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
22-
<dependentAssembly>
23-
<publisherPolicy apply="no"/>
24-
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
25-
<bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.121.2.0"/>
26-
</dependentAssembly>
27-
</assemblyBinding>
28-
</runtime>
2920
<oracle.manageddataaccess.client>
3021
<version number="*">
3122
<dataSources>

src/NEventStore.Persistence.Sql.Core.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{C68C81
4949
EndProject
5050
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NEventStore.Serialization.Binary.Core", "..\dependencies\NEventStore\src\NEventStore.Serialization.Binary\NEventStore.Serialization.Binary.Core.csproj", "{F61C5A0D-19AA-A699-E2E6-6707B9455C12}"
5151
EndProject
52+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NEventStore.Persistence.Oracle.Core.Tests", "NEventStore.Persistence.Oracle.Tests\NEventStore.Persistence.Oracle.Core.Tests.csproj", "{E9B5C2A0-F241-C417-EFE2-69CC4C1CBB19}"
53+
EndProject
5254
Global
5355
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5456
Debug|Any CPU = Debug|Any CPU
@@ -91,6 +93,10 @@ Global
9193
{F61C5A0D-19AA-A699-E2E6-6707B9455C12}.Debug|Any CPU.Build.0 = Debug|Any CPU
9294
{F61C5A0D-19AA-A699-E2E6-6707B9455C12}.Release|Any CPU.ActiveCfg = Release|Any CPU
9395
{F61C5A0D-19AA-A699-E2E6-6707B9455C12}.Release|Any CPU.Build.0 = Release|Any CPU
96+
{E9B5C2A0-F241-C417-EFE2-69CC4C1CBB19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
97+
{E9B5C2A0-F241-C417-EFE2-69CC4C1CBB19}.Debug|Any CPU.Build.0 = Debug|Any CPU
98+
{E9B5C2A0-F241-C417-EFE2-69CC4C1CBB19}.Release|Any CPU.ActiveCfg = Release|Any CPU
99+
{E9B5C2A0-F241-C417-EFE2-69CC4C1CBB19}.Release|Any CPU.Build.0 = Release|Any CPU
94100
EndGlobalSection
95101
GlobalSection(SolutionProperties) = preSolution
96102
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)