Skip to content

Configuration.GenerateSchemaCreationScript() Exception with Oracle8iDialect and above #1438

Closed
@greenlight2k

Description

@greenlight2k

Issue since NH5:

When I use:

NHibernate.Cfg.Configuration.GenerateSchemaCreationScript(new Oracle8iDialect());

an exception is thrown:

Message:
Dialect does not support DbType.String
Parametername: typecode

StackTrace:
at NHibernate.Dialect.TypeNames.Get(DbType typecode)
at NHibernate.Dialect.Dialect.GetTypeName(SqlType sqlType)
at NHibernate.Mapping.Column.GetDialectTypeName(Dialect dialect, IMapping mapping)
at NHibernate.Mapping.Column.GetSqlType(Dialect dialect, IMapping mapping)
at NHibernate.Mapping.Table.SqlCreateString(Dialect dialect, IMapping p, String defaultCatalog, String defaultSchema)
at NHibernate.Cfg.Configuration.GenerateSchemaCreationScript(Dialect dialect)

I checked the sourcecode and found the problem:
Inside the constructor of Oracle8iDialect there was a line removed:
RegisterCharacterTypeMappings(); (line 84)

I inherited a new class from Oracle8iDialect and added that line in the constructor.
This should fix the issue. But it needs to be confirmed and checked further.

Question is: Why was that mapping removed?

public sealed class Oracle10gFixed : Oracle10gDialect
{
    public Oracle10gFixed()
    {
        RegisterCharacterTypeMappings();
    }
}

UPDATE:

This issue does not occur with SchemaUpdate or SchemaExport,
only with the GenerateSchemaCreationScript method in Configuration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions