• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLGrammarException: could not retrieve snapshot:

 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kept encountering the exception when trying to save a record to the MySQL table. I'm using Struts2, Hibernate 3 & MySQL 5. Stacktrace is given below. Does anyone knows what could be wrong?

Did a few tries like setting the table character settings at Hibernate property; use ` for the PASSWORD column; dropped all foreign keys, etc.

Help is greatly appreciated!

 
Chengwei Lee
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved after looking at the generated SQL. Here's a snippet of the hibernate.cfg.xml that went wrong:



The schema was repeated twice in the generated SQL due to this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic