I have recently updated hibernate in my application to 5.4.4.Final. And now, I have faced with the following exception during deployment.
ERROR [org.hibernat
You simple used the dafault MAX_VALUE of a sequence, which is too high for the Java LONG datatype.
Fortunatelly you may any time reset the MAX_VALUE with ALTER SEQUENCE to a lower number that will cause no problems.
Example
CREATE SEQUENCE SEQ_TEST START WITH 1 INCREMENT BY 1 NOCYCLE;
select MAX_VALUE from ALL_SEQUENCES where SEQUENCE_NAME = 'SEQ_TEST';
MAX_VALUE
----------
9999999999999999999999999999
ALTER SEQUENCE SEQ_TEST
MAXVALUE 9223372036854775807;
select MAX_VALUE from ALL_SEQUENCES where SEQUENCE_NAME = 'SEQ_TEST';
MAX_VALUE
----------
9223372036854775807
and BTW
it looks strange that hibernate tries to read metadata about all sequences, not only about used in my application.
Hibernate uses select * from all_sequences
as an Oracle Dialect to get the sequence information. Note that ALL_SEQUENCES
does not mean
all existing sequences, but all sequences, that your Hibernate database user (DBUSER from the connection pool) is granted to use - which is of course
absolute correct.