Hibernate 3.3.1.GA, SpringFramework 3.1.1.RELEASE, annotations, MySQL 5.5.x
I've got a small web service I'm putting together that successfully creates objects that end up in the DB, but it can't update existing objects. I'm not really sure where to look. The code looks basically like this:
Code:
SaveCard card = mSaveCardDAO.findForPlayerAndGame(p, g);
if (card == null)
{
card = mSaveCardDAO.createSaveCard(p, g, inData);
}
else
{
sGCLogger.info("----------------------------------- Updating save card date");
card.setLastModified(new Date());
card.setData(inData);
mSaveCardDAO.makePersistent(card);
sGCLogger.info("----------------------------------- Made persistent");
}
Hibernate logs this. What does "ignoring persistent instance" mean?
Code:
06:54:14.089 INFO web.ServiceController (ServiceController.java:357) ----------------------------------- Updating save card date
06:54:14.089 TRACE impl.SessionImpl (SessionImpl.java:1316) setting flush mode to: AUTO
06:54:14.089 DEBUG transaction.JDBCTransaction (JDBCTransaction.java:82) begin
06:54:14.089 DEBUG jdbc.ConnectionManager (ConnectionManager.java:444) opening JDBC connection
06:54:14.090 DEBUG transaction.JDBCTransaction (JDBCTransaction.java:87) current autocommit status: true
06:54:14.090 DEBUG transaction.JDBCTransaction (JDBCTransaction.java:90) disabling autocommit
06:54:14.090 TRACE jdbc.JDBCContext (JDBCContext.java:237) after transaction begin
06:54:14.090 TRACE def.AbstractSaveEventListener (AbstractSaveEventListener.java:511) persistent instance of: com.lz.gamecenter.model.SaveCard
06:54:14.090 TRACE def.DefaultSaveOrUpdateEventListener (DefaultSaveOrUpdateEventListener.java:122) ignoring persistent instance
06:54:14.091 TRACE def.DefaultSaveOrUpdateEventListener (DefaultSaveOrUpdateEventListener.java:159) object already associated with session: [com.lz.gamecenter.model.SaveCard#1]
06:54:14.091 DEBUG transaction.JDBCTransaction (JDBCTransaction.java:134) commit
06:54:14.091 TRACE impl.SessionImpl (SessionImpl.java:364) automatically flushing session
06:54:14.091 TRACE jdbc.JDBCContext (JDBCContext.java:228) before transaction completion
06:54:14.091 TRACE impl.SessionImpl (SessionImpl.java:420) before transaction completion
06:54:14.091 DEBUG transaction.JDBCTransaction (JDBCTransaction.java:227) re-enabling autocommit
06:54:14.092 DEBUG transaction.JDBCTransaction (JDBCTransaction.java:147) committed JDBC Connection
06:54:14.092 TRACE jdbc.JDBCContext (JDBCContext.java:242) after transaction completion
06:54:14.092 DEBUG jdbc.ConnectionManager (ConnectionManager.java:325) transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
06:54:14.092 TRACE impl.SessionImpl (SessionImpl.java:449) after transaction completion
06:54:14.092 TRACE impl.SessionImpl (SessionImpl.java:1316) setting flush mode to: MANUAL
06:54:14.092 DEBUG impl.SessionImpl (SessionImpl.java:401) disconnecting session
06:54:14.093 TRACE jdbc.ConnectionManager (ConnectionManager.java:403) performing cleanup
06:54:14.093 DEBUG jdbc.ConnectionManager (ConnectionManager.java:464) releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
06:54:14.093 TRACE jdbc.JDBCContext (JDBCContext.java:242) after transaction completion
06:54:14.093 DEBUG jdbc.ConnectionManager (ConnectionManager.java:325) transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
06:54:14.093 TRACE impl.SessionImpl (SessionImpl.java:449) after transaction completion
06:54:14.093 INFO web.ServiceController (ServiceController.java:361) ----------------------------------- Made persistent
The code is wrapped in a org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.
Any ideas or suggestions? Thank you.