Skip to content

Are exceptions suppressed on purpose upon initialization? #25

Open
@conradreuter

Description

@conradreuter

Consider the following initialization code I used for evaluating NEventStore:

Wireup
.Init()
.UsingSqlPersistence("Core NEventStore")
.WithDialect(new MsSqlDialect())
.UsingJsonSerialization()
.Build();

It all ran fine in a standalone console applicaiton. However, when I tried to use it in the initialization routines of an ASP.NET web application. The root cause of the error is, of course, missing CREATE TABLE permissions on the IIS user within my database.

It took me some good four hours to detect this, because the initialization method of the SqlPersistenceEngine actively suppresses exceptions. I used a custom ILog with breakpoints in each method to jump through all log messages. It seems that the following things happen:

  1. attempting to CREATE TABLE
  2. fails due to insufficient permissions, but the exception is suppressed
  3. transaction gets completed
  4. attempting to CREATE TABLE again
  5. fails due to transaction being already completed

In the end I was confronted with an exception that had really nothing much to do with the actual root cause of the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions