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.


        <domain name="Default"

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's gravatar image


edited Aug 31 '11 at 12:31

Hello sobelk,

Thanks for your interest to DataObjects.Net.

It seems that the database scheme extractor produces incorrect SQL script. Will be fixed shortly.

(Mar 02 '11 at 12:42) Dmitri Maximov Dmitri%20Maximov's gravatar image

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?

(Mar 02 '11 at 12:50) GigMastersTech GigMastersTech's gravatar image

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.

(Mar 02 '11 at 14:16) Alex Yakunin Alex%20Yakunin's gravatar image

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.

(Mar 02 '11 at 14:39) Dmitri Maximov Dmitri%20Maximov's gravatar image

Clear - sobelk, I'm sorry for bothering you with this.

(Mar 02 '11 at 23:57) Alex Yakunin Alex%20Yakunin's gravatar image

One Answer:

Fixed in revision 7270. The updated installers will be available soon (1 urgent bug in in work).

answered Mar 03 '11 at 05:43

Dmitri%20Maximov's gravatar image

Dmitri Maximov

The binaries are published.

See 'Nightly builds' section on the downloads page.

(Mar 05 '11 at 11:37) Dmitri Maximov Dmitri%20Maximov's gravatar image

I confirmed that this bug is resolved in build 7299. Thank you!

(Mar 09 '11 at 10:54) GigMastersTech GigMastersTech's gravatar image

You are welcome!

(Mar 10 '11 at 02:41) Dmitri Maximov Dmitri%20Maximov's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA