The database file is larger than the configured maximum database size

I am getting the following error as I am trying to open POS operations:

Bellow is the Detailed Report for the error:

-----------------------------
[General Info]

Application: SambaPOS
Version:     4.1.58
Region:      en
DB:          CE
Machine:     ACER
User:        user
Date:        5/12/2016
Time:        1:21 PM

User Explanation:

user said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Reflection.TargetInvocationException
Message:     Exception has been thrown by the target of an invocation.
Source:      mscorlib
Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()

Inner Exception 1
Type:        System.Data.EntityCommandExecutionException
Message:     An error occurred while reading from the store provider's data reader. See the inner exception for details.
Source:      System.Data.Entity
Stack Trace: at System.Data.Common.Internal.Materialization.Shaper`1.StoreRead()
   at System.Data.Common.Internal.Materialization.Shaper`1.RowNestedResultEnumerator.MoveNext()
   at System.Data.Common.Internal.Materialization.Shaper`1.ObjectQueryNestedEnumerator.TryReadToNextElement()
   at System.Data.Common.Internal.Materialization.Shaper`1.ObjectQueryNestedEnumerator.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Samba.Persistance.Data.Dao.Select[TSource,TResult](Expression`1 expression, Expression`1 predictate, Expression`1[] includes)
   at Samba.Persistance.Implementations.EntityDao.UpdateEntityScreenItemBadges(IList`1 entityScreenItems)
   at Samba.Services.Implementations.EntityModule.EntityService.UpdateEntityScreenItemBadges(IList`1 entityScreenItems)
   at Samba.Modules.EntityModule.EntityDashboardViewModel.Refresh(EntityScreen entityScreen)
   at Samba.Modules.EntityModule.EntitySwitcherViewModel.ActivateDashboard(EntityScreen entityScreen)
   at Samba.Modules.EntityModule.EntitySwitcherViewModel.ActivateEntityScreen(EntityScreen entityScreen)
   at Samba.Modules.EntityModule.EntitySwitcherViewModel.<.ctor>b__2(EventParameters`1 x)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.InvokeAction(Action`1 action, TPayload argument)
   at Microsoft.Practices.Prism.Events.EventSubscription`1.<>c__DisplayClass2.<GetExecutionStrategy>b__0(Object[] arguments)
   at Microsoft.Practices.Prism.Events.EventBase.InternalPublish(Object[] arguments)
   at Microsoft.Practices.Prism.Events.CompositePresentationEvent`1.Publish(TPayload payload)
   at Samba.Presentation.Services.Common.ExtensionMethods.Publish[TEventsubject](TEventsubject eventArgs, String eventTopic, Action expectedAction)

Inner Exception 2
Type:        System.Data.SqlServerCe.SqlCeException
Message:     The database file is larger than the configured maximum database size. This setting takes effect on the first concurrent database connection only. [ Required Max Database Size (in MB; 0 if unknown) = 257 ]
Source:      SQL Server Compact ADO.NET Data Provider
Stack Trace: at System.Data.SqlServerCe.SqlCeDataReader.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeDataReader.IsEndOfRowset(Int32 hr)
   at System.Data.SqlServerCe.SqlCeDataReader.Move(DIRECTION direction)
   at System.Data.SqlServerCe.SqlCeDataReader.Read()
   at System.Data.Common.Internal.Materialization.Shaper`1.StoreRead()

-----------------------------

[Assembly Info]

Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.5.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.5.0
PresentationCore, Version=4.0.0.0
Stateless, Version=1.0.0.0
System.Core, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
System.Windows.Forms, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.5.0
PropertyTools, Version=2012.4.14.1

-----------------------------

[System Info]

Operating System
-Microsoft Windows 8.1 Pro
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = -240
--FreePhysicalMemory = 1008868
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 6.3.9600

Machine
-ACER
--Manufacturer = ASUS
--Model = All Series
--TotalPhysicalMemory = 2013515776
--UserName = 

-----------------------------

Quick search indicates you might be able to increase max DB size using this connection string:

Data Source=MyData.sdf;Max Database Size=256;Persist Security Info=False;

Change the size accordingly… specified in MB between 16 and 4091 (4GB).


Even if that is possible, you really need to upgrade to SQL Express or SQL LocalDB since they support very large databases, they are more robust, and data access is far quicker. And SQL CE is no longer supported.

While you’re at it, why are you running 4.1.58? Latest V4 is 4.1.82

Hi QMcKay,

Thank you a lot for the quick response. I have tried changing the connection string and I get the following error:

The connection string is as bellow:

Data Source=C:\Users\user\Documents\SambaPOS4\SambaPOS41.sdf;Max Database Size=600;Persist Security Info=False;

Also here is the contents of Samba Settings.txt file:

<?xml version="1.0"?><SettingsObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MessagingServerPort>8080</MessagingServerPort>
<ConnectionString>Data Source=C:\Users\user\Documents\SambaPOS4\SambaPOS41.sdf;Max Database Size=600;Persist Security Info=False;</ConnectionString>
<StartMessagingClient>false</StartMessagingClient>
<DefaultHtmlReportHeader>
&lt;style type='text/css'&gt; 
html
{
  font-family: 'Courier New', monospace;
  font-size: 11px;
} 
&lt;/style&gt;
</DefaultHtmlReportHeader>
<CurrentLanguage>en</CurrentLanguage>
<OverrideLanguage>false</OverrideLanguage>
<OverrideWindowsRegionalSettings>false</OverrideWindowsRegionalSettings><DefaultRecordLimit>100</DefaultRecordLimit>
<WindowScale>1</WindowScale><FooterHeight>0</FooterHeight>
<UseBoldFonts>false</UseBoldFonts>
<ValidateExitButton>false</ValidateExitButton>
<AllowMultipleClients>false</AllowMultipleClients>
<CallerIdDeviceName /><ScaleDeviceName />
<AdditionalDevices>[]</AdditionalDevices>
<AutoMigrate>true</AutoMigrate>
<TokenLifeTime />
</SettingsObject>

First thing to try would be to remove those parts of the Connection String to see if you go back to getting your original error, or if you get the new error.

If you get the original error after removing those parts, then it might be that SambaPOS does not support those parameters in your connection string.

If you still get the new error after removing those parts, then there is a problem finding the DB in that path.

What was your original Connection String before you tried changing it? Did it always include the Path? Or just the Filename?

It always contained the full path since the beginning, as we wanted to take a full backup of the database folder manually using windows task scheduler. Prior to the changes following was the settings file:

<?xml version="1.0"?><SettingsObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-

instance" 

xmlns:xsd="http://www.w3.org/2001/XMLSchema"><MessagingServerPort>8080</MessagingS

erverPort><ConnectionString>Data Source=C:\Users\user\Documents

\SambaPOS4\SambaPOS41.sdf</ConnectionString><StartMessagingClient>false</StartMess

agingClient><DefaultHtmlReportHeader>
&lt;style type='text/css'&gt; 
html
{
  font-family: 'Courier New', monospace;
  font-size: 11px;
} 
&lt;/style&gt;</DefaultHtmlReportHeader><CurrentLanguage>en</CurrentLanguage><Over

rideLanguage>false</OverrideLanguage><OverrideWindowsRegionalSettings>false</Overr

ideWindowsRegionalSettings><DefaultRecordLimit>100</DefaultRecordLimit><WindowScal

e>1</WindowScale><FooterHeight>0</FooterHeight><UseBoldFonts>false</UseBoldFonts><

ValidateExitButton>false</ValidateExitButton><AllowMultipleClients>false</AllowMul

tipleClients><CallerIdDeviceName /><ScaleDeviceName /><AdditionalDevices>

[]</AdditionalDevices><AutoMigrate>true</AutoMigrate><TokenLifeTime 

/></SettingsObject>

Once the following of the connection string are removed the program opens fine.

Max Database Size=256;Persist Security Info=False;

However once POS is clicked it shows the same exact previous error which says that the database is larger than max configured. Also I found out that on the connection string if I just key in the database file name it creates a total new database on the application path located under Program files. And once again when I key in the Max Database Size into the connection string application returns with an error that it cannot connect to the database.

Please advice.

Best advice is to upgrade to sql express and convert your CE to sql also update to current version 4.1.82

Hi kendash,
Thank you a lot for the feedback, I guess that should be better.

Can I please have a guide to migrate the existing database to SQL and upgrade of the software to the mentioned version. And I really need it urgent as the service has been down for more than an 48hrs now.

1 Like

How do i check what database platform is my Samba running on?

Login as admin and double click on samba logo in lop left.
There is a suffix on the window title bar showing the DB type.

Mines showing this. What do i make of that. Sorry for my less technical skills.

I started having issues as this thread indicates problem. Really feeling overwhelmed with solution.

Looking for guide to resolve. Any help is appreciated.

You are using CE compact edition.

What is my solution here, please?

It’s explained in the thread your responding too. Qmckay provided a link a few threads up.

Thanks.

I am a bit dull in this area of field.

Do i need to open samba database file (.sdf) in sql management studio to edit that string?

I have not seen tutorial added showing how to open which file to add that string.

You need to follow the guide posted above to convert your CE database to full SQL

All the info you need is posted in a full tutorial above

I am in the middle of installation. SQL Installation was completed.

I am trying to migrate CE to SQL express.

Encountering error with standalone 3.7 SQL Server compact 4.0 keep hanging up on me. Please help.

Finally got past the point of SQLCEToolbox getting hung. Now having issue due to Max DB limitation.

Apparently the Max Size has nothing to do with the DB itself; rather it is a default Memory allocation.

In any case, you should be able to configure the Max Size parameter when you define the connection to the Database File (SDF).

Thanks QMckay. That worked, i just changed value from 256 to 500 and output ran.

Now the problem i encounter is it exported more then 25 files instead of one per instruction on migrating. Which one should i use to copy and paste query.