title: Getting exception java.sql.BatchUpdateException: Data truncation: Data too long for column 'XXXX'
body: <p>I have my custom portlet in liferay6 and I am getting exception while inserting long data in database as <code>java.sql.BatchUpdateException: Data truncation: Data too long for column 'XXXX' at row 1</code></p>
  <p>This is happening even when I have given following parameter in the <code>portlet-modal-hints</code></p>
  <pre><code>&lt;field name=&quot;advurl&quot; type=&quot;String&quot;&gt;
      &lt;hint name=&quot;max-length&quot;&gt;4000&lt;/hint&gt;
  &lt;/field&gt;
  </code></pre>
  <p>This is the String in column which is throwing error: <code>http://www.coderanch.com/t/435635/java/java/Regular-expression-check-specific-special</code></p>
  <p>can anyone please tell me why this is still throwing an error?</p>
  <h3>Error stack</h3>
  <pre><code>Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.DataException: Could not execute JDBC batch update
      at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:30)
      at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:122)
      at com.liferay.portal.kernel.dao.orm.ClassLoaderSession.flush(ClassLoaderSession.java:218)
      at com.liferay.portal.service.persistence.BatchSessionImpl.update(BatchSessionImpl.java:95)
      at com.liferay.portal.service.persistence.BatchSessionUtil.update(BatchSessionUtil.java:50)
      at emenu.advertise.database.service.persistence.advertisePersistenceImpl.updateImpl(advertisePersistenceImpl.java:505)
      ... 178 more
  Caused by: org.hibernate.exception.DataException: Could not execute JDBC batch update
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:102)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
      at com.liferay.portal.dao.orm.hibernate.SessionImpl.flush(SessionImpl.java:119)
      ... 182 more
  Caused by: java.sql.BatchUpdateException: Data truncation: Data too long for column 'advlink' at row 1
      at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1257)
      at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:943)
      at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
      at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)
      at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)
      ... 188 more
      
  </code></pre>
  <p>can anyone give me some suggestion?</p>