0 Replies Latest reply on Jan 14, 2005 9:47 AM by dkuhn

    Error while persisting CMP with Blob-Field

    dkuhn

      I'm not able to save a blob field in MS SQL database.

      EJB-signature:

      /**
      * Returns the wob
      *
      * @return the wob
      * @ejb.interface-method view-type="local"
      * @ejb.persistent-field
      * @ejb.persistence column-name="WOB"
      */
      public abstract byte[] getWob();
      /**
      * Sets the wob
      *
      * @param wob
      * the new wob value
      * @ejb.interface-method view-type="local"
      */
      public abstract void setWob(byte[] wob);

      When the ejb is persisted i get the following error from the container:
      ------------------------
      15:46:52,046 ERROR [Wob] Could not create entity
      java.sql.SQLException: [DETROIT]String or binary data would be truncated.
      at com.inet.tds.e.a(Unknown Source)
      at com.inet.tds.b.do(Unknown Source)
      at com.inet.tds.b.execute(Unknown Source)
      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:276)
      at org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCSQLServerCreateCommand.executeInsert(JDBCSQLServerCreateCommand.java:49)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:286)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:137)
      ------------------------

      Any help is appreciated

      Dominik Kuhn