James Imap
  1. James Imap
  2. IMAP-114

Used Column for storing the message content is to small

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1
    • Component/s: JPA Mailbox
    • Labels:
      None

      Description

      Tim posted on ml:

      Caused by: <openjpa-1.2.1-r752877:753278 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Data truncation: Data too long for column 'content' at row 1

      {prepstmnt 23802890 INSERT INTO Message (id, bodyStartOctet, content, contentOctets, mediaType, subType, textualLineCount) VALUES (?, ?, ?, ?, ?, ?, ?) [params=(long) 2501, (int) 786, (InputStream) java.io.ByteArrayInputStream@125bbd3, (long) 396202, (String) multipart, (String) mixed, (null) null]} [code=1406, state=22001]
      FailedObject: org.apache.james.imap.jpa.mail.model.JPAMessage@1126d91
      at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
      at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4197)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
      at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:72)
      at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:131)
      at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:82)
      at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:89)
      at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:72)
      at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
      at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:105)
      at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
      at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
      at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:717)
      at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
      ... 31 more
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Data truncation: Data too long for column 'content' at row 1 {prepstmnt 23802890 INSERT INTO Message (id, bodyStartOctet, content, contentOctets, mediaType, subType, textualLineCount) VALUES (?, ?, ?, ?, ?, ?, ?) [params=(long) 2501, (int) 786, (InputStream) java.io.ByteArrayInputStream@125bbd3, (long) 396202, (String) multipart, (String) mixed, (null) null]}

      [code=1406, state=22001]
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:57)
      at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:866)
      at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
      at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1586)
      at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:151)
      at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:120)
      ... 41 more

        Activity

        Norman Maurer created issue -
        Hide
        Norman Maurer added a comment -

        Fixed in revision 918157

        Show
        Norman Maurer added a comment - Fixed in revision 918157
        Norman Maurer made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Tim-Christian Mundt added a comment -

        Unfortunately - while increasing column size fixes the problem - the annotation @Column(length=1048576000) doesn't make OpenJPA create a LONGBLOB column. I tried adding a columnDefinition="LONGBLOB" to it, but also no success, I always get a simple BLOB column. Could this be an issue with OpenJPA? At least it was once: https://issues.apache.org/jira/browse/OPENJPA-740 (still open).

        Show
        Tim-Christian Mundt added a comment - Unfortunately - while increasing column size fixes the problem - the annotation @Column(length=1048576000) doesn't make OpenJPA create a LONGBLOB column. I tried adding a columnDefinition="LONGBLOB" to it, but also no success, I always get a simple BLOB column. Could this be an issue with OpenJPA? At least it was once: https://issues.apache.org/jira/browse/OPENJPA-740 (still open).
        Hide
        Norman Maurer added a comment - - edited

        Hi Tim,

        you are right and after diggin in the openjpa source code the bug still seems to exists I just edit the jira ticket, set it to "blocker" and changed it from "improvment" to "bug".

        https://issues.apache.org/jira/browse/OPENJPA-740

        Thx,
        Norman

        Show
        Norman Maurer added a comment - - edited Hi Tim, you are right and after diggin in the openjpa source code the bug still seems to exists I just edit the jira ticket, set it to "blocker" and changed it from "improvment" to "bug". https://issues.apache.org/jira/browse/OPENJPA-740 Thx, Norman
        Norman Maurer made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Hide
        Norman Maurer added a comment -

        please update to trunk or add the following line in the persistence.xml:

        <property name="openjpa.jdbc.DBDictionary" value="blobTypeName=LONGBLOB"/>

        This is needed till openjpa 1.3 or 2.0.0 was released.

        Show
        Norman Maurer added a comment - please update to trunk or add the following line in the persistence.xml: <property name="openjpa.jdbc.DBDictionary" value="blobTypeName=LONGBLOB"/> This is needed till openjpa 1.3 or 2.0.0 was released.
        Norman Maurer made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Norman Maurer
            Reporter:
            Norman Maurer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development