We have a PostgreSQL database (8.x & 9.x) using Hibernate 3.3.2 - older proprietary style with .hbm.xml files and are using hibernate managed sequences.
If the app/db is shut down, where does hibernate store the meta-data? how does it know what the nextval is on startup?
For a sequence created in the DB, the DB manages/stores the sequence, but if we use a sequence in a .hbm.xml file like this:
<id name="id" column="id" > <generator class="native"></generator> </id>
Where does hibernate keep track of numbers? any way to see the ordering of this? and if the app is shut down and starts up, where does it store/keep the max number to start sequencing again when the app starts up?
I have read that there is no guarantee of sequential order of id's for database id's (we are using for primary keys).
the problem is that we are hitting the upper limit every three months running out of primary keys hitting the int limit ( +2147483647 ).
This indicates a consumption of millions of records per day but we have no idea where this is coming from except some probable bug in Hibernate that is skipping sequence numbers by the hundreds of thousands or millions at a time.
any ideas?
|