Persistence of Saga Data on SQL Server using Nhibernate


(Alexander) #1

By default, installers create a table named the same as the saga data class name. We’d like to have some sort of indication of what endpoint the saga belongs to. One of the ways is to specify default schema in AppSettings in the config as in

add key=“NServiceBus/Persistence/NHibernate/default_schema” value="[endpoint_name]"

This means, we’d have to keep creating schemas for each new endpoint, set permissions to it, etc.
Can someone suggest better approaches?
Thanks


(Ramon Smits) #2

Another approach is to use a different database, but that has the same ceremony regarding configuration.

You can also use a custom mapping where you override the table name. See this doco on how to override the mapping:

Currently we do not have an easy way to add a prefix/suffix for all tables created.

– Ramon


(Alexander) #3

Seems like the schema-per-endpoint approach is easier


(Udi Dahan) #4

Hi Alexander,

We’d like to have some sort of indication of what endpoint the saga belongs to.

Could you explain more why you’d want to be able to see this in the database?
If it were possible to see this information somewhere else (ServicePulse or ServiceInsight), would that help?

Cheers,
Udi