Orleans.Persistence.Oracle 8.2.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet add package Orleans.Persistence.Oracle --version 8.2.0.7                
NuGet\Install-Package Orleans.Persistence.Oracle -Version 8.2.0.7                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Orleans.Persistence.Oracle" Version="8.2.0.7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Orleans.Persistence.Oracle --version 8.2.0.7                
#r "nuget: Orleans.Persistence.Oracle, 8.2.0.7"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Orleans.Persistence.Oracle as a Cake Addin
#addin nuget:?package=Orleans.Persistence.Oracle&version=8.2.0.7

// Install Orleans.Persistence.Oracle as a Cake Tool
#tool nuget:?package=Orleans.Persistence.Oracle&version=8.2.0.7                

Fix: ReadStateAsync() ⇒ async/await error

Orleans Oracle Providers

Orleans is a framework that provides a straight-forward approach to building distributed high-scale computing applications, without the need to learn and apply complex concurrency or other scaling patterns.

Orleans.Oracle

is a package that use Oracle as a backend for Orleans providers like Cluster Membership, Grain State storage.

Installation

Nuget Packages are provided:

  • Orleans.Persistence.Oracle
  • Orleans.Persistence.Oracle.State
  • Orleans.Clustering.Oracle

Silo


IHostBuilder builder = Host.CreateDefaultBuilder(args)
    .UseOrleans(silo =>
    {
        silo.Configure<ClusterOptions>(options =>
        {
            options.ClusterId = "DEV";
            options.ServiceId = "DEV";

        });
        silo.UseOracleClustering(option =>
        {
            option.ConnectionString = "your-connection-string";
        });
        silo.AddOracleGrainStorage("Test1Context", option =>
        {
            option.ConnectionString = "your-connection-string";
            option.Tables = new List<Type> { typeof(TestModel) };
        });
        silo.AddOracleGrainStorage("Test2Context", option =>
        {
            option.ConnectionString = "your-connection-string";
            option.Tables = new List<Type> { typeof(TestModel) };
        });
        silo.ConfigureLogging(logging => logging.AddConsole());

        silo.ConfigureEndpoints(
            siloPort: 11111,
            gatewayPort: 30001,
            advertisedIP: IPAddress.Parse("192.168.68.41"),
            listenOnAnyHostAddress: true
            );

        silo.Configure<ClusterMembershipOptions>(options =>
        {
            options.EnableIndirectProbes = true;
            options.UseLivenessGossip = true;
        });
    })
    .UseConsoleLifetime();

using IHost host = builder.Build();

await host.RunAsync();

Use Persistence

  • BaseEntity is require
  • property name is uppercase
  • [Description("TEST_TABLE")] is table name
  • [Description("VARCHAR2(50)")] is oracle data type

BaseEntity

[GenerateSerializer]
public class BaseEntity
{
    [Description("VARCHAR2(128)")]
    [Id(0)]
    [Key]
    public string ID { get; set; } = Guid.NewGuid().ToString();

}

Table

[Description("TEST_TABLE")]
[GenerateSerializer]
public class TestModel : BaseEntity
{
    [Description("VARCHAR2(50)")]
    [Id(0)]
    public string MYCOLUM { get; set; }
}

interface grain

public interface IHelloGrain : IGrainWithGuidKey
{
    ValueTask<string> SayHello(string greeting);
    Task<string> GetMyColumn();

    void SaveColumn();
}

impliment grain

using Orleans.Persistence.Oracle.States;
public class HelloGrain : Grain, IHelloGrain
{
    private readonly ILogger _logger;

    private readonly IPersistentState<BaseState<TestModel>> _test;
    public HelloGrain(ILogger<HelloGrain> logger, [PersistentState("test", "Test1Context")] IPersistentState<BaseState<TestModel>> test)
    {
        _logger = logger;
        _test = test;
    }

    public async Task<string> GetCount()
    {
        await _test.ReadStateAsync();
        return _test.State.Items.Count.ToString();
    }

    public async Task AddItem(TestModel model)
    {
        _test.State.Items = [model,];
        await _test.WriteStateAsync();
    }
}

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.2.2 69 10/31/2024
8.2.1.1 69 10/31/2024
8.2.1 71 10/29/2024
8.2.0.7 108 8/29/2024
8.2.0.6 120 8/21/2024
8.2.0.5 146 8/13/2024
8.2.0.4 88 8/3/2024
8.2.0.3 73 8/2/2024
8.2.0.2 86 8/1/2024
8.2.0.1 72 7/31/2024
8.2.0 76 7/31/2024