locked
Getting exception "The data area passed to a system call is too small." RRS feed

  • Question

  • I have created a SQL Compact 4 database using Entity Framework Code First.
    Everything worked until I just started testing with a bigger data set. I now get this exception:
     
      InnerException: System.Data.SqlServerCe.SqlCeException
           Message=The data area passed to a system call is too small.
           Source=SQL Server Compact ADO.NET Data Provider
           ErrorCode=-2147467259
           HResult=-2147024774
           NativeError=0
           StackTrace:
                at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
                at System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
                at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
                at System.Data.SqlServerCe.SqlCeMultiCommand.ExecuteReader(CommandBehavior behavior)
                at System.Data.SqlServerCe.SqlCeMultiCommand.ExecuteDbDataReader(CommandBehavior behavior)
                at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
           InnerException: 
     
    The exception occurs while performing a normal select query. I get this exception in my application and also when I connect and query using Visual Studio 2010.
    The query that I was performing:
    SELECT    Value
    
    FROM      DbMasterStringTokens
    
    WHERE    (Value = N'Location/[b]Finland/[b]Päijät-Häme/[b]Lahti/[b]Hämeenkatu')
    
    
    The database properties
    Case sensitive = true
    Encryption Mode = UNENCRYPTED
    Locale  = English - United States
     

    How can I resolve this?

    Thursday, August 4, 2011 12:35 PM

Answers

  • I have looked at your repro, and changing the LCID to 1035 (and possibly other European codepages) fixes the issue
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    • Marked as answer by KJian_ Friday, August 12, 2011 8:57 AM
    Friday, August 5, 2011 7:18 AM

All replies

  • Have you tried with a non-case sensitive database ??
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Thursday, August 4, 2011 1:23 PM
  • Hi Erik,

    No, I have not tried with a non-case sensitive database because I explicitly need to do case sensitive lookups. Is there a limitation to using case sensitive collation?

    Thursday, August 4, 2011 1:41 PM
  • It was just in order to narrow down the issue. It could be a bug!? 
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Thursday, August 4, 2011 1:42 PM
  • I just tried to run with the same data set and a new database, created from a case insensitive connection string:

    Case Sensitive=false;LCID=1033;
    
    I get the same "The data area passed to a system call is too small" exception
    Thursday, August 4, 2011 2:19 PM
  • Could you email me a repro ? (via Contact info on my Blog) and I will try to repro.
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Thursday, August 4, 2011 2:51 PM
  • I have looked at your repro, and changing the LCID to 1035 (and possibly other European codepages) fixes the issue
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Friday, August 5, 2011 7:18 AM
  • I have looked at your repro, and changing the LCID to 1035 (and possibly other European codepages) fixes the issue
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    • Marked as answer by KJian_ Friday, August 12, 2011 8:57 AM
    Friday, August 5, 2011 7:18 AM
  • I have the same error here.

    Can we expect a fix for this?

    Thanks

    Jus

     

    Wednesday, August 10, 2011 7:17 PM
  • Have you tried the workaround? (LCID=something european)
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Thursday, August 11, 2011 6:34 AM
  • How can I set the LCID?

     

    Thursday, August 11, 2011 9:14 PM
  • On teh connection string used to create the database (or Compact it)
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Friday, August 12, 2011 6:09 AM
  • No, that does not work.

    Here is the code I used for compacting the db:

    string connString = string.Format("Data Source=\"{0}\";LCID=1031", this.DataBasePath);
    
    var engine = new System.Data.SqlServerCe.SqlCeEngine(connString);
          
    engine.Compact(connString);
    

    I'm not sure, if this works.

    Friday, August 12, 2011 7:26 PM
  • Hi again,

    I have set the lcid to different values (e.g. 1031 or 1035) but it does not help.

    If anyone is interested, I can send a sdf file wherewith you can reproduce the problem.

    The sql statement:

    SELECT        TrackID
    FROM            Track
    WHERE        (SoundFile LIKE 'D:\Hörbücher\A\Ahern, Cecelia\F%')
    

    works without problems.

    The sql statement:

    SELECT        TrackID
    FROM            Track
    WHERE        (SoundFile LIKE 'D:\Hörbücher\A\Ahern, Cecelia\Fü%')
    

    returns the above error. In German it is:

    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    SQL Execution Error.

    Executed SQL statement: SELECT TrackID FROM Track WHERE (SoundFile LIKE 'D:\Hörbücher\A\Ahern, Cecelia\Fü%')
    Error Source: SQL Server Compact ADO.NET Data Provider
    Error Message: Der an einen Systemaufruf übergebene Datenbereich ist zu klein.
    ---------------------------
    OK   Hilfe  
    ---------------------------

    (The data area passed to a system call is too small.)

     

    Thanks for your help.

    Jürgen

     

     

    Tuesday, November 1, 2011 8:48 PM
  • You can send it to me, and I will have a look (email via Contact info on my blog)
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Wednesday, November 2, 2011 12:48 PM
  • Hi Erik,

    thanks. I have sent you the sdf file.

    Jürgen

     

    Wednesday, November 2, 2011 7:31 PM
  • What should I do know? Erik can reproduce the problem.

    There is already a connect bug for this issue: http://connect.microsoft.com/SQLServer/feedback/details/683114/getting-exception-the-data-area-passed-to-a-system-call-is-too-small-in-sql-server-compact-4

    I need a solution. Should I contact Microsoft support?

    Thanks

    Jürgen

     

    Wednesday, November 23, 2011 4:09 PM
  • Yes, that would be the best approach
    Please mark as answer, if this was it. Visit my SQL Server Compact blog
    Wednesday, November 23, 2011 4:50 PM
  • Hi,

    OK, I have contacted MS support. It seems that there is already an internal fix for this which will be released to the public in a CU.

    Hopefully it will be released soon.

    Jus

     

    Monday, December 19, 2011 1:28 PM
  • The connect bug was updated. The issue is fixed for the next release.

    No words on a hotfix or CU yet... :-(

     

    Tuesday, January 24, 2012 10:03 PM