title: GenericJDBCException - Could not update
body: <p>I'm trying to update a record in the database and I'm getting the following error.</p>
  
  <p>I'm trying to figure out what exactly this error means. SQLCODE -302 says one of the values may have exceeded the allowed length, so I have checked all the values that are being saved into the db - When I took the values and run the query manually, records are being updated.</p>
  
  <blockquote>
    <p>JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions
    SQL Error: -302, SQLState: 22001 </p>
    
    <p>JDBCException E</p>
    
    <p>org.hibernate.util.JDBCExceptionReporter logExceptions DB2 SQL error:
    SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null AbstractFlush E</p>
    
    <p>org.hibernate.event.def.AbstractFlushingEventListener
    performExecutions Could not synchronize database state with session</p>
    
    <p>org.hibernate.exception.GenericJDBCException: could not update:
    [com.me.model.MyClass#6849972133]     at
    org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
      at
    org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
      at
    org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      at
    org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2000)
      at
    org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1909)
      at
    org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2149)
      at
    org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:75)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)   at
    org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
      at
    org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
      at
    org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
      at
    org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
      at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)   at
    org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:394)
      at
    org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
      at
    org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:658)
      at
    org.springframework.orm.hibernate3.HibernateTemplate.update(HibernateTemplate.java:654)</p>
  </blockquote>