EF: An error occurred while executing the command definition

EF: An error occurred while executing the command definition

Postby kulibin » Tue 23 Sep 2008 07:23

Hi!
My EDM contains abstract base class and it's childs classes. Classes mapped according to table-per-class scenario. I try to get list of base-class-entities from EDM. See exception text below:
----------------------------------------------------------------------------------
System.Data.EntityCommandExecutionException was unhandled
Message="An error occurred while executing the command definition. See the inner exception for details."
Source="System.Data.Entity"
StackTrace:
at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()
at MonitoringDbTest.Program.Main(String[] args) in C:\Documents and Settings\oleg\Мои документы\Visual Studio 2008\Projects\MonitoringDbTest\MonitoringDbTest\Program.cs:line 42
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: CoreLab.PostgreSql.PgSqlException
Message="UNION типы text и integer не совпадают"
Source="CoreLab.PostgreSql"
ErrorCode=-2147467259
CallStack=""
DetailMessage=""
FileName=".\src\backend\parser\parse_coerce.c"
Hint=""
LineNumber=1024
Position=0
ProcedureName="select_common_type"
StackTrace:
at CoreLab.PostgreSql.a.d(Boolean A_0)
at CoreLab.PostgreSql.a.ae()
at CoreLab.PostgreSql.a.b(String A_0)
at CoreLab.PostgreSql.a.l()
at CoreLab.PostgreSql.PgSqlCommand.a(Boolean A_0, Int32 A_1, Int32 A_2)
at CoreLab.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at CoreLab.PostgreSql.Entity.f.a.a(CommandBehavior A_0)
at CoreLab.Common.Entity.f.a.b(CommandBehavior A_0)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
InnerException:
-------------------------------------------------------------------------------

Why it may happen?
kulibin
 
Posts: 12
Joined: Thu 18 Sep 2008 06:33

Postby Shalex » Wed 24 Sep 2008 10:03

Please provide us with the SQL script that creates the tables and fills them with data, an *.edmx file content and the code where the error occurs. Alternatively, you can send me (alexsh at devart.com) a small test project and a script.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Postby Shalex » Mon 29 Sep 2008 10:43

Kulibin, thank you for the good test example. It allows us to make quick fix of the problem. The next build of PostgreSQLDirect .NET will be available in 7-10 days.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for PostgreSQL