liferay - Data too long for column mysql -


i using liferay framework mysql database , keep getting error :

error [http-bio-80-exec-5][render_portlet_jsp:157] com.mysql.jdbc.mysqldatatruncation: data truncation: data long column 'odlukakomentar' @ row 1     @ com.mysql.jdbc.mysqlio.checkerrorpacket(mysqlio.java:4118)     @ com.mysql.jdbc.mysqlio.checkerrorpacket(mysqlio.java:4052)     @ com.mysql.jdbc.mysqlio.sendcommand(mysqlio.java:2503)     @ com.mysql.jdbc.mysqlio.sqlquerydirect(mysqlio.java:2664)     @ com.mysql.jdbc.connectionimpl.execsql(connectionimpl.java:2794)     @ com.mysql.jdbc.preparedstatement.executeinternal(preparedstatement.java:2155)     @ com.mysql.jdbc.preparedstatement.executeupdate(preparedstatement.java:2458)     @ com.mysql.jdbc.preparedstatement.executebatchserially(preparedstatement.java:2006)     @ com.mysql.jdbc.preparedstatement.executebatch(preparedstatement.java:1467)     @ com.mchange.v2.c3p0.impl.newproxypreparedstatement.executebatch(newproxypreparedstatement.java:1723)     @ org.hibernate.jdbc.batchingbatcher.doexecutebatch(batchingbatcher.java:70)     @ org.hibernate.jdbc.abstractbatcher.executebatch(abstractbatcher.java:268)     @ org.hibernate.engine.actionqueue.executeactions(actionqueue.java:268)     @ org.hibernate.engine.actionqueue.executeactions(actionqueue.java:184)     @ org.hibernate.event.def.abstractflushingeventlistener.performexecutions(abstractflushingeventlistener.java:321)     @ org.hibernate.event.def.defaultflusheventlistener.onflush(defaultflusheventlistener.java:51)     @ org.hibernate.impl.sessionimpl.flush(sessionimpl.java:1216)     @ com.liferay.portal.dao.orm.hibernate.sessionimpl.flush(sessionimpl.java:144)     @ com.liferay.portal.kernel.dao.orm.classloadersession.flush(classloadersession.java:237)     @ com.liferay.portal.service.persistence.batchsessionimpl.update(batchsessionimpl.java:86) 

this field "odlukakomentar" in database longtext type. solution ? thanks

according the docs (linking 5.0),

longtext [character set charset_name] [collate collation_name]

a text column maximum length of 4,294,967,295 or 4gb (2^32 − 1) characters. effective maximum length less if value contains multibyte characters. effective maximum length of longtext columns depends on configured maximum packet size in client/server protocol , available memory. each longtext value stored using 4-byte length prefix indicates number of bytes in value.

you might want check configuration of database driver, actual length (i doubt come close 4g bytes). if service-builder component (because you're mentioning liferay), might want google "liferay service builder model hints" , give service builder better hint of expected column sizes.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -