Cannot create a row of size 8156 which is greater than the allowable maximum row size of 8060.

0
Hello, We have an application which has many fields added for one of the Domain Model entities. When trying to commit this entity for saving the values into the DB, it throws an error , the values are not added into the DB and the app is crashing. The error we get is : Cannot create a row of size 8156 which is greater than the allowable maximum row size of 8060. If I remove some of the data from the input fields from the interface, then I can commit/save the new row into the DB. Is this a known issue on Mendix Modeler version 5.19 which we are using? Is there a solution for fixing this issues? Thank you
asked
4 answers
1

Mendix objects are stored in table rows in Postgres. Postgres stores rows in database blocks. These blocks have a maximum size of 8060. A row has to fit in a database block, meaning that all the data in a row combined cannot exceed 8060 bytes.

So the problem is not the number of attributes, but the amount of data stored in these attributes. So it may be OK to have 80 attributes of 10 bytes, but 2 attributes both containing 5000 bytes can be too big.

You also need to consider the character encoding used for text attributes. Variable encoding, e.g. UTF-8, will use between 1-4 bytes when storing a single character, whereas UTF16 always uses 2 bytes per character. So it may not be possible to determine up front based on your domain model how large your row can become.

answered
0

Hi Alina,

When you have reached to maximum number of attributes on an entity, you have to reconsider to domain model. Apply 1 to many and many to many associations to create a not-redundant database structure. I don't know your situation but I don't think there is no quick-fix to resolve this.

answered
0

I think this is an issue on the underlying database. Is your environment in the Mendix cloud or on premise? Maybe this post helps you further: http://stackoverflow.com/questions/7631546/entity-framework-row-size-greater-than-allowable-maximum-row-size-of-8060

answered
0

In addition to Roeland's stackoverflow, which accurate but I don't think Mendix can do this there should be validation rules in place to prevent that exact error.

It is more likely that you have reached the max nr of attributes on an entity, as Thijs suggests. You should rethink your domain model.
The only way to achieve this error is if you have a few hundred string fields set to a really long max length. Having an entity that large is just waiting for problems. The best and only way to resolve this is to rethink your domain model, break your entity down in smaller entities and rethink the field sizes (putting everything to unlimited just in case has a big performance impact).

http://stackoverflow.com/questions/3905934/cannot-create-a-row-of-size-8937-which-is-greater-than-the-allowable-maximum-of

answered