Particular / NServiceBus.NHibernate

Persistence support for NServiceBus using NHibernate
https://docs.particular.net/nservicebus/nhibernate/
Other
12 stars 32 forks source link

Storing business data is impossible when using SQL Server transport and Oracle-based saga or outbox persistence #90

Closed johnsimons closed 9 years ago

johnsimons commented 9 years ago

Symptoms

NHibernateStorageContext class is not registered in the container making it impossible to store business data in sync with message consumption and storing of NServiceBus' data.

Who's affected

Users who have SQL Server transport and Oracle-backed NHibernate persistence for sagas or outbox.

SzymonPobiega commented 9 years ago

@johnsimons I'll investigate

johnsimons commented 9 years ago

@SzymonPobiega you need to install "Oracle Database 11g Express Edition".

johnsimons commented 9 years ago

@SzymonPobiega any news on this ? Should we pair today ?

johnsimons commented 9 years ago

@SzymonPobiega is this fixed now ? Do we backport it ?

SzymonPobiega commented 9 years ago

it was introduced in 6.1.0 and 6.1.1 is going to fix it so no backporting needed. All the acceptance tests are passing on MSMQ (both SQL Server and Oracle). There are problems with acceptance test for SQL Server transport and Oracle persistence but the failures seem to be random.

I was hesitant with releasing it because I wanted to replace the behavior with 258. I believe it is more appropriate. What do you think?

johnsimons commented 9 years ago

@SzymonPobiega would you like me to see why the tests are failing for SQL Server transport and Oracle persistence ?

SzymonPobiega commented 9 years ago

@johnsimons in that comment you mentioned problems with always exposing the context. Could you evaluate if my proposal solves these problems and we can go forward?

SzymonPobiega commented 9 years ago

@johnsimons yeah, if you could take a look it would be awesome

johnsimons commented 9 years ago

@SzymonPobiega found an issue, it looks like the SqlServer transport expects an error queue configuration even in sendonly mode, this is the error:

System.Configuration.ConfigurationErrorsException: Faults forwarding requires an error queue to be specified. Please add a 'MessageForwardingInCaseOfFaultConfig' section to your app.config
 or configure a global one using the powershell command: Set-NServiceBusLocalMachineSettings -ErrorQueue {address of error queue}
   at NServiceBus.Features.ErrorQueueSettings.GetConfiguredErrorQueue(ReadOnlySettings settings) in c:\BuildAgent\work\888dd942b44bad5a\src\NServiceBus.SqlServer\ErrorQueueSettings.cs:line 45
   at NServiceBus.Features.SqlServerTransportFeature.Configure(FeatureConfigurationContext context, String connectionStringWithSchema) in c:\BuildAgent\work\888dd942b44bad5a\src\NServiceBus.SqlServer\Config\SqlServerTransportFeature.cs:line 63
   at NServiceBus.Transports.ConfigureTransport.Setup(FeatureConfigurationContext context) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Transports\ConfigureTransport.cs:line 44

I've raised an issue for it in https://github.com/Particular/NServiceBus.SqlServer/issues/78

johnsimons commented 9 years ago

Both When_handler_throws.Should_receive_exception_from_handler and When_handler_throws_AggregateException.Should_receive_exact_AggregateException_exception_from_handler are doing asserts on specific stacktrace text, and because we modify the pipeline based on configuration settings those tests cannot ever pass!

Not sure how to handle this, IMHO, those tests are constantly giving us grief, I would remove them from the AT suite.

@SzymonPobiega @andreasohlund @SimonCropp thoughts ?

SzymonPobiega commented 9 years ago

@johnsimons but why do these stack trace tests pass for SQL Server and fail with Oracle?

johnsimons commented 9 years ago

I don't think they do, can you run them ?

On Tuesday, April 14, 2015, Szymon Pobiega notifications@github.com wrote:

@johnsimons https://github.com/johnsimons but why do these stack trace tests pass for SQL Server and fail with Oracle?

— Reply to this email directly or view it on GitHub https://github.com/Particular/NServiceBus.NHibernate/issues/90#issuecomment-92685152 .

SzymonPobiega commented 9 years ago

All the failures in NHibernate+SQLServer transport suite come from oracle dll: NServiceBus.NHibernate.AcceptanceTests-Oracle.dll

johnsimons commented 9 years ago

Unfortunately that doesn't mean much, run the tests locally to ensure, and compare the stacktraces. We have had false positives before :(

On Tuesday, April 14, 2015, Szymon Pobiega notifications@github.com wrote:

All the failures in NHibernate+SQLServer transport suite http://builds.particular.net/viewLog.html?buildId=103150&tab=buildResultsDiv&buildTypeId=NServiceBusNHibernate_AcceptanceTestsSqlServer come from oracle dll: NServiceBus.NHibernate.AcceptanceTests-Oracle.dll

— Reply to this email directly or view it on GitHub https://github.com/Particular/NServiceBus.NHibernate/issues/90#issuecomment-92687216 .

johnsimons commented 9 years ago

@SzymonPobiega when is this fix going to go out ?

SzymonPobiega commented 9 years ago

I'll be working on it this afternoon. Should be enough. The other thing is, remember the if statement that you didn't like? The nasty one that checked if you are on SQL transport with SQL persistence and outbox etc. I replaced it with implementation of https://github.com/Particular/Requirements/issues/258 and raised a concern but that one is not yet approved.

We can either go back to the old if or wait for it to be approved. The last thing to be done seems to be fixing the customer communication which Udi pointed out is not fully understandable.

johnsimons commented 9 years ago

@SzymonPobiega what version is this going out in ?

SzymonPobiega commented 9 years ago

6.1.1

SzymonPobiega commented 9 years ago

Let's bundle it to 6.2.0 because I don't see to release 2 versions, one after another.