• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

identifier of an instance modifier error. HELP!?

 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys : I have the following strange error after saving an object to the database and then queryying



I have no idea why the getFlushIfRequired is necessary, and on top of that, I cant tell why it is that an unrelated set of objects cant correctly load when executing a query AFTER a successfull, flushed insert occurred.

Please help this is driving me crazy and Im on a strict deployment deadline for monday morning and this bug just came up !?!?!?!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post a little bit of your code in that section? And point to which line fires the exception.

Thanks

Mark
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well what you posted was just a query. However, Hibernate has this mechanism, in which if you have dirty stuff that hasn't been flushed yet, like new objects, or updated objects, and Hibernate thinks that the query will be different if that stuff was flushed or not, then Hibernate will issue a flush.

I think, not positive, that this is what happened. I see you use this staticDao.getSession() methodology, which I have seen some others do. Is this the open-view-in-session pattern. But maybe you can manually call a flush before your do your query?

call staticDAO.getSession.flush(); just before the creating the criteria and report back if that helps, if not what lines causes a problem.

In my first post, I asked for you to point out which line throws the exception, but you didn't so I am not quite sure where the exception occurs.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic