chucknorris/roundhouse — Issue #39: KeyNotFoundException when trying to use custom DatabaseType
Author: mjmeintjes
Created: 2011-12-14 10:12:40+00:00
State: open

Hi

We are trying to use a custom DatabaseType, inheriting from the SqlServer one.

The problem is that as soon as we specify the custom DatabaseType, we get the following error:

```
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at roundhouse.infrastructure.persistence.NHibernateSessionFactoryBuilder.build_session_factory(Action`1 additional_function)
2011-12-14 11:36:00,363 [RemoteServerSchedulerClient_Worker-2] ERROR roundhouse - RoundhousE encountered an error. You were running in a transaction though, so the database should be in the state it was in prior to this piece running. This does not include a drop/create or any creation of a database, as those items can not run in a transaction.
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at roundhouse.infrastructure.persistence.NHibernateSessionFactoryBuilder.build_session_factory(Action`1 additional_function)
at roundhouse.databases.DefaultDatabase`1.set_repository()
at roundhouse.databases.AdoNetDatabase.open_connection(Boolean with_transaction)
at roundhouse.migrators.DefaultDatabaseMigrator.open_connection(Boolean with_transaction)
at roundhouse.runners.RoundhouseMigrationRunner.run()
```
It seems that currently the possible database types are hardcoded in NHibernateSessionFactoryBuilder.

Is it possible to add a facility to register a new database type?