Folks, I have just switched the underlying database from MySQL to PostgreSQL (corporate requirement) and now my reads work fine, but my writes do not. In other words:
...throws
org.hibernate.exception.SQLGrammarException: could not get next sequence value
In the Eclipse debugger, examining
HibernateException, I see:
(exception) SQLGrammarException
(cause) PSQLException
(detailMessage) "could not get next sequence value"
(sql) "select nextval( 'hibernate_sequence' )"
Now, I am able to throw anything I try into the database by hand (via
psql). There is no problem of privilege. And, as I say, I can read out (via Hibernate
Criteria) anything I like and do same using
psql. I will confess I have no experience so far in switching Hibernate dialects and this is the first time I've used PostgreSQL.
I have created a very minimal table,
Fun, to see if I'm using some columns wrong in the eyes of PostgreSQL, but no matter if I reduce the object to just a single, integer field, I still get this, so it's not about using some bizarre thing like
DATE,
TIMESTAMP or even some OneToOne, OneToMany, etc. construct incorrectly.
(FYI)
hibernate.cfg.xml:
(used to be)
I thought there wouldn't be too much to do beyond this configuration switcheroo. I'd be grateful if anyone could point me somewhere to go.
Much thanks,
Russ Bateman