[jboss-user] [EJB 3.0] - Primary key generator best practices? (Postgres specific)
asack
do-not-reply at jboss.com
Mon Jun 4 23:24:42 EDT 2007
Guys, we are using postgres 8.1.3 for our application and running into a lot of problems - mainly dealing with primary key management. I have tracked down one issue in that our current configuration does not use the autovacuum stuff in postgres to cleanup the database over a lot of transactions.
But the other issue which is semi related is that EJB3/Hibernate is not dealing with the primary keys correctly? We have instances where EJB3/Hibernate tries to insert a new entity over an already existing primary key? i.e. EJB3/Hibernate does not get the next key properly. All of our tables are using AUTO for primary key generation.
Question, should we be specifing our own generator function? Should we be using @SequenceGenerator annotatoin instead of just relying on AUTO?
(on a side note, how do I specify a generic generator function across multiple tables using annotations?)
Any advice would come much appreciated!
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051157#4051157
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051157
More information about the jboss-user
mailing list