Hello, I'm new to Data Objects .NET and running into some trouble getting it started. I'm able to build a domain in a fresh database just fine, but when I point it to my legacy database, Domain.Build
fails with "System.Data.SqlClient.SqlException: Ambiguous column name 'object_id'."
This seems to happen regardless of which upgrade mode I choose, what entities exist in my assembly, or whether any entities exist at all. I've tried various connectionUrl and connectionString variations and credentials. I'd like to run DO in LegacyValidate
mode eventually, but I have also tried LegacySkip
, Validate
and PerformSafely
with the same result.
Any ideas? I'm using .NET Framework Version 4.0.30319, SQL Server 10.0.2531 and DataObjects.Net 4.4.0 build 7249.
Configuration:
<Xtensive.Orm>
<domains>
<domain name="Default"
upgradeMode="LegacyValidate"
connectionUrl="sqlserver://localhost/gigma2">
</domain>
</domains>
</Xtensive.Orm>
Error transcript:
Server Error in '/' Application.
Ambiguous column name 'object_id'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Ambiguous column name 'object_id'.
Source Error:
Line 36: Private Sub InitializeDataObjects()
Line 37: Dim config = DomainConfiguration.Load("Default")
Line 38: Dim domain = Xtensive.Orm.Domain.Build(config)
Line 39:
Line 40: End Sub
Source File: C:\inetpub.api\api\Global.asax.vb Line: 38
Stack Trace:
[SqlException (0x80131904): Ambiguous column name 'object_id'.]
System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase) +410
System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData) +518
System.Func`2.EndInvoke(IAsyncResult result) +0
Xtensive.Core.<>c__DisplayClass4`2.<InvokeAsync>b__3() +63
Xtensive.Orm.Building.Builders.DomainBuilder.BuildSchemasAsync(Domain domain, SchemaUpgradeHandler upgradeHandler) +285
Xtensive.Orm.Building.Builders.DomainBuilder.SynchronizeSchema(SchemaUpgradeMode schemaUpgradeMode) +365
Xtensive.Orm.Building.Builders.DomainBuilder.BuildDomain(DomainConfiguration configuration, DomainBuilderConfiguration builderConfiguration) +594
Xtensive.Orm.Upgrade.UpgradingDomainBuilder.BuildStageDomain(UpgradeStage stage) +406
Xtensive.Orm.Upgrade.UpgradingDomainBuilder.Build(DomainConfiguration configuration) +419
Xtensive.Orm.Domain.Build(DomainConfiguration configuration) +31
GigMastersAPI.MvcApplication.InitializeDataObjects() in C:\inetpub.api\api\Global.asax.vb:38
GigMastersAPI.MvcApplication.Application_Start() in C:\inetpub.api\api\Global.asax.vb:51
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Offending SQL statement:
select t.schema_id, fic.object_id,
fi.unique_index_id, fc.name, fc.is_default,
fic.column_id, fic.type_column_id, fl.name, i.name
from sys.tables t inner join sys.fulltext_index_columns as fic on t.object_id = fic.object_id
inner join sys.fulltext_languages as fl on fic.language_id = fl.lcid
inner join sys.fulltext_indexes fi on fic.object_id = fi.object_id
inner join sys.fulltext_catalogs fc on fc.fulltext_catalog_id = fi.fulltext_catalog_id
inner join sys.indexes as i on fic.object_id = i.object_id
and fi.unique_index_id = i.index_id
where t.schema_id = 1 order by t.schema_id, object_id, column_id
asked
Mar 02 '11 at 11:44
GigMastersTech
27●11●11●15
Hello sobelk,
Thanks for your interest to DataObjects.Net.
It seems that the database scheme extractor produces incorrect SQL script. Will be fixed shortly.
Thanks for taking a look. Is there a quick fix I can employ in the meantime, such as routing around Domain.Build? Is it worth trying DO.NET 4.3 or do you expect it to encounter the same problem?
It definitely doesn't worth to try v4.3 - there were no any serious changes related to this part there.
Could you send us the database schema you're using, or the backup of empty DB? This should significantly help us to resolve the issue faster.
In fact, database scheme is not required, as it is obvious that the SQL script in extractor is incorrect ('order by' part).
As I've said earlier, this will be fixed shortly and updated binaries will be published.
Clear - sobelk, I'm sorry for bothering you with this.