I inherited a project that uses EclipseLink JPA to store objects in any SQL database. It currently ships with a local Derby DB distribution. During some tests, I found that the program throws the following exception:
012-08-03 10: 21: 11.357 - UnitOfWork (32349505) - Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java. sql.SQLDataException: truncation error was encountered while trying to compress VARCHAR 'some really really long text' to length 255. Error code: 20000
Obviously, VARCHAR is not (usually) suitable for storing strings longer than 255 characters, but I did not find a piece of code where the object variable is explicitly assigned to the VARCHAR field. I understand that JPA or EclipseLink will automatically assign this to you, so my question, where I haven't found a simple answer yet, is this:
How can I make sure that EclipseLink / JPA stores strings longer than 255 characters?
Greetings
source
share