Question
· Mar 19, 2019

Entity Framework Provider issue when "Support Delimited Identifiers" is turned off

I'm attempting to use the .NET Entity Framework provider that is provided by InterSystems (see: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GBMP_eframe).  In our environment, the "Support Delimited Identifiers" option is turned off and we are not allowed to turn it on without significant testing effort.  When this setting is off, the SQL that is generated by the Entity Framework provider is not considered valid and therefore the provider doesn't work (it DOES work, however, when this setting is turned ON).

Do you know of any way to work around this issue? Again, we don't have the option of turning the "Support Delimited Identifiers" option ON unfortunately.

Discussion (3)0
Log in or sign up to continue

Here's the SQL:

SELECT 
"Extent1"."BENEFIT_CATEGORY_ID" AS "BENEFIT_CATEGORY_ID", 
"Extent1"."NAME" AS "NAME", 
"Extent1"."GROUPING" AS "GROUPING", 
"Extent1"."ENTRY_ORDER" AS "ENTRY_ORDER", 
"Extent1"."SEARCH_ORDER" AS "SEARCH_ORDER", 
"Extent1"."DATA_TYPE" AS "DATA_TYPE", 
"Extent1"."CATEGORY_STATUS" AS "CATEGORY_STATUS", 
"Extent1"."PLANTYPE" AS "PLANTYPE", 
"Extent1"."DATA_CHOICES" AS "DATA_CHOICES", 
"Extent1"."CREATE_DATETIME" AS "CREATE_DATETIME", 
"Extent1"."CREATE_USER_ID" AS "CREATE_USER_ID", 
"Extent1"."LAST_EDIT_DATETIME" AS "LAST_EDIT_DATETIME", 
"Extent1"."LAST_EDIT_USER_ID" AS "LAST_EDIT_USER_ID"
FROM "BENCODE"."BENEFITCATEGORY" AS "Extent1"

And here's the stack trace:

System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> InterSystems.Data.CacheClient.CacheException: [SQLCODE: <-1>:<Invalid SQL statement>]
[Location: <Prepare>]
[%msg: < IDENTIFIER expected, : found^SELECT :%qpar(1) . :%qpar(2) AS :%qpar(3) , :%qpar(4) . :%qpar(5) AS :%qpar(6) , :%qpar(7) . :%qpar(8) AS :%qpar(9) , :%qpar(10) . :%qpar(11) AS :%qpar(12) , :%qpar(13) . :%qpar(14) AS :%qpar(15) , :%qpar(16) . :%qpar(17) AS :%qpar(18) , :%qpar(19) . :%qpar(20) AS :%qpar(21) , :%qpar(22) . :%qpar(23) AS :%qpar(24) , :%qpar(25) . :%qpar(26) AS :%qpar(27) , :%qpar(28) . :%qpar(29) AS :%qpar(30) , :%qpar(31) . :%qpar(32) AS :%qpar(33) , :%qpar(34) . :%qpar(35) AS :%qpar(36) , :%qpar(37) . :%qpar(38) AS :%qpar(39) FROM :%qpar>]
    at InterSystems.Data.CacheClient.CacheADOConnection.GetServerError(Int32 rc)
   at InterSystems.Data.CacheClient.CacheADOConnection.processError(Int32 error, Int32 allowError)
   at InterSystems.Data.CacheClient.InStream.readHeader(CacheCommand stmt, Int32 stmt_id, Int32 type, Int32 allowError, Boolean requestData)
   at InterSystems.Data.CacheClient.InStream.readHeader(CacheCommand stmt, Int32 type, Int32 allowError)
   at InterSystems.Data.CacheClient.CacheCommand.sendDirectQueryRequest()
   at InterSystems.Data.CacheClient.CacheCommand.Execute()
   at InterSystems.Data.CacheClient.CacheCommand.ExecuteReaderObject(CommandBehavior behavior, String method)
   at InterSystems.Data.CacheClient.CacheCommand.ExecuteReader(CommandBehavior behavior)
   at InterSystems.Data.CacheClient.CacheCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c(DbCommand t, DbCommandInterceptionContext`1 c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
   at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
--- End of inner exception stack trace ---
    at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
   at InterSystems.Data.Entity.DefaultCacheExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
   at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
 

This SQL works when "Support Delimited Identifiers" is turned ON but in our environment this setting is turned OFF and we're not allowed to turn it on without significant testing effort that is cost prohibitive.  Is there a way we can configure the Entity Framework provider to work around this?

Hi,

I am trying to use Entity Framework for Intersystems Cache from Visual Studio 2019, but i couldn't see the Cache Data Source. I got only the below items. Are you able to see Cache Data source? If yes, could you please share the details how to bring this

I followed all the steps mentioned in "Database First Section" from the URL https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...