+3  A: 

Hibernate often defers updates until the session is flushed. To test if this is the issue in your case, insert a getSession().flush() after your update statement.

How do you manage transactions? Flushing will occur automatically when the session is committed, but if you have a faulty transaction configuration, you may end up committing the JDBC connection but not committing the transaction tied to the Hibernate session.

Edit: Based on your update, I see that FlushMode is set to NEVER at some row:

[TRACE] 2010-07-23 00:29:26,303 :org.hibernate.impl.SessionImpl.setFlushMode(SessionImpl.java:1316): setting flush mode to: NEVER

I suspect this is the problem. It causes the session never to flush automatically - which is usually what you want to do in a read-only transaction, not when you modify data. It seems like you are running without transactions (autocommit set to true - which is not recommended by the way). The Javadoc for OpenSessionInViewFilter provides some clues:

This filter will by default not flush the Hibernate Session, with the flush mode set to FlushMode.NEVER. It assumes to be used in combination with service layer transactions that care for the flushing: The active transaction manager will temporarily change the flush mode to FlushMode.AUTO during a read-write transaction, with the flush mode reset to FlushMode.NEVER at the end of each transaction. If you intend to use this filter without transactions, consider changing the default flush mode (through the "flushMode" property).

In other words, you have two options: either set flushMode on your OpenSessionInViewFilter to AUTO, or, turn off autocommit and configure a transaction manager such as HibernateTransactionManager.

waxwing
Yes, good catch +1
Pascal Thivent
Thank you so much! Adding getSession().flush() to the update method did work. I did try setting flushMode to "AUTO" in the OpenSessionInViewFilter, but I still had to manually invoke getSession().flush() to run the update (with autocommitt on and off).
John
With flushMode set to AUTO and having disabled autocommit I was able to get it working by doing; Transaction tr = getSession().beginTransaction(); getSession().update(vo); tr.commit();. Thanks again
John
+2  A: 

Since you are you using Spring, I would recommend that you use Spring's PlatformTransactionManager to manage your transactions. As part of transaction management Spring automatically flushes the session. This means that you don't have to worry about any of these aspects in your code.

Spring has a OpenSessionInViewFilter that hooks up to the transaction manager to start/flush sessions and you can annotate your methods with Spring's @Transactional to indicate that you want a 'write' transaction for a particular method. This should update your records.

Vineeth