SQL Server CE "max database size" connection string parameter has no impact on database size???

You Can Take it With You

Syndication

News

  • Don't miss the next Windows Mobile Webcast... Unit Testing for Mobile Devices: http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032382824&EventCategory=4&culture=en-US&CountryCode=US.

If you ever lookup the SQL Server Compact Edition (SSCE) “max database size” connection string parameter in the MSDN SqlCeConnection.ConnectionString help document, you get an explanation something like this... “The maximum size of the database, in Megabytes

Not very explanatory but it seems reasonable to assume that “max database size” is a connection string parameter that one might use when creating or compacting a database so that the database storage can be optimized for that particular size.

But if you check out the list of possible SSCE errors, you find that error code 25102 (SSCE_M_INITPROPCONFLICT) can be returned when... “Another user has opened the database with [a] different [max database size] initialization property [value]”.

The opportunity for this error tells us that the parameter is not limited to database creation but rather is something that we can (should) specify anytime we open a SSCE database. The “max database size” parameter has nothing to do with the way a SSCE database is created or stored; rather the parameter tells SSCE how much shared memory to allocate for the data structures that are used to allow an application to interact with the database.

Your application can not interact with a database that is larger than the amount of shared memory that SSCE allocates for the database connection. Because there is only one shared memory block allocated for each database, each concurrent connection to a particular database must specify the same value for “max database size”.

Laxmi Narsimha Rao Oruganti from the SSCE team has just posted an excellent blog entry detailing the story of SSCE connection shared memory. It's short but very informative; I encourage you to take a look.


Posted Jun 14 2007, 08:58 AM by jim-wilson

Add a Comment

(required)  
(optional)
(required)  
Remember Me?