{"action":"created","issue":{"url":"https://api.github.com/repos/NServiceBusSqlPersistence/NServiceBus.SqlPersistence/issues/2","repository_url":"https://api.github.com/repos/NServiceBusSqlPersistence/NServiceBus.SqlPersistence","labels_url":"https://api.github.com/repos/NServiceBusSqlPersistence/NServiceBus.SqlPersistence/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/NServiceBusSqlPersistence/NServiceBus.SqlPersistence/issues/2/comments","events_url":"https://api.github.com/repos/NServiceBusSqlPersistence/NServiceBus.SqlPersistence/issues/2/events","html_url":"https://github.com/NServiceBusSqlPersistence/NServiceBus.SqlPersistence/issues/2","id":197965099,"number":2,"title":"SqlPersistence with SqlTransport and EF (Core)","user":{"login":"Tobias-Gr","id":24821586,"avatar_url":"https://avatars.githubusercontent.com/u/24821586?v=3","gravatar_id":"","url":"https://api.github.com/users/Tobias-Gr","html_url":"https://github.com/Tobias-Gr","followers_url":"https://api.github.com/users/Tobias-Gr/followers","following_url":"https://api.github.com/users/Tobias-Gr/following{/other_user}","gists_url":"https://api.github.com/users/Tobias-Gr/gists{/gist_id}","starred_url":"https://api.github.com/users/Tobias-Gr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tobias-Gr/subscriptions","organizations_url":"https://api.github.com/users/Tobias-Gr/orgs","repos_url":"https://api.github.com/users/Tobias-Gr/repos","events_url":"https://api.github.com/users/Tobias-Gr/events{/privacy}","received_events_url":"https://api.github.com/users/Tobias-Gr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-29T07:24:07Z","updated_at":"2016-12-30T07:38:15Z","closed_at":null,"body":"Hi Simon,\r\n\r\nI appreciate your efforts, very promising project!\r\n\r\nDoes SQLPersistence support the following scenario?\r\n\r\n-Persistence: SqlPersistence (SQL Server)\r\n-Transport: SqlTransport\r\n-Business data: Entity Framework Core (on .net 4.61 runtime)\r\n-all data in one database; no DTC, no Outbox but local/native single TransactionScope\r\n\r\nIf yes:\r\n-Do I have to/Should I use SqlPersistenceSession (https://docs.particular.net/nservicebus/sql-persistence/ ) to get the context for the business data or is it sufficient to use the same connection string? Could you provide a sample how to use SqlPersistenceSession with EF Core?\r\n-Why is Outbox used in this sample https://docs.particular.net/samples/outbox/sqltransport-sqlpersistence-ef/ ? In my understanding Outbox is not necessary because all data is in one database.\r\n\r\nThanks!\r\nTobias"},"comment":{"url":"https://api.github.com/repos/NServiceBusSqlPersistence/NServiceBus.SqlPersistence/issues/comments/269741728","html_url":"https://github.com/NServiceBusSqlPersistence/NServiceBus.SqlPersistence/issues/2#issuecomment-269741728","issue_url":"https://api.github.com/repos/NServiceBusSqlPersistence/NServiceBus.SqlPersistence/issues/2","id":269741728,"user":{"login":"SzymonPobiega","id":163318,"avatar_url":"https://avatars.githubusercontent.com/u/163318?v=3","gravatar_id":"","url":"https://api.github.com/users/SzymonPobiega","html_url":"https://github.com/SzymonPobiega","followers_url":"https://api.github.com/users/SzymonPobiega/followers","following_url":"https://api.github.com/users/SzymonPobiega/following{/other_user}","gists_url":"https://api.github.com/users/SzymonPobiega/gists{/gist_id}","starred_url":"https://api.github.com/users/SzymonPobiega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SzymonPobiega/subscriptions","organizations_url":"https://api.github.com/users/SzymonPobiega/orgs","repos_url":"https://api.github.com/users/SzymonPobiega/repos","events_url":"https://api.github.com/users/SzymonPobiega/events{/privacy}","received_events_url":"https://api.github.com/users/SzymonPobiega/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T07:38:15Z","updated_at":"2016-12-30T07:38:15Z","body":"Let me give you some examples how the persistence session works in different cases. I guess I should then move this to the documentation...\r\n\r\nAssumption: NServiceBus *always* requires a persistence to be configured so there is always some kind of synchronized storage session in the context. \r\n\r\n### SQL Server Transport in native tx mode + NHibernate persistence\r\n\r\nNot possible because NHibernate won't accept an externally created `DbTransaction`\r\n\r\n### SQL Server Transport in TransactionScope mode + NHibernate persistence\r\n\r\nTransport opens a `TransactionScope` which is present during entire message processing. The transport connection is closed as soon as message is received. The persistence opens its own connection. If both connections share same connection string, no DTC is involved. User data access code has to get the connection/session from the synchronized storage session in order to avoid DTC escalation\r\n\r\n### SQL Server Transport in native tx mode + Outbox + NHibernate persistence\r\n\r\nTransport opens and holds its `DbConnection` and `DbTransaction`. The outbox opens a `TransactionScope` that suppresses all incoming transaction context and, inside that scope, opens its own connection/session. This session is used to ensure exactly once processing so all user data access code has to go through that session. Otherwise the outbox won't guarantee idempotence.\r\n\r\n### SQL Persistnce\r\n\r\nSQL persistence works similarly to the NHibernate persistence but has the advantage of accepting an external `DbTransaction` so it can work in the native mode (first one described above). Other modes of operation work the same as with NHibernate persistence."}}
{"actor":{"display_login":"SzymonPobiega"}}