SqlException - Value too long for column (Corda)

149 views Asked by At

getting above exception during flow execution (state persistence). My contract state includes a field with type ByteArray, assigned value is an XML file 14kb long. I suspected an exception such as this might occur with a large data field member...so have I ran into a design constraint of Corda or should I be using another type (e.g. Blob/Clob?), if so is the solution simply to define the member of type Blob/Clob in the schema or is there another approach I should take? Thanks.

1

There are 1 answers

3
Joel On

Currently, Corda uses an H2 database. Try using a Clob data type instead (it's explicitly recommended for XML: http://www.h2database.com/html/datatypes.html#clob_type).

In the future, Corda will not be tied to H2, and different rules will apply depending on the database used.