[hibernate-dev] SchemaCreatorImpl always creating a poolable sequence

Mark Rotteveel mark at lawinegevaar.nl
Thu Jul 28 05:54:11 EDT 2016


I'm working on improving support for Firebird in Hibernate, and I have 
run into a problem where 
org.hibernate.tool.schema.internal.SchemaCreatorImpl is always trying to 
create a pooled sequence.

Specifically:

applySqlStrings(
         dialect.getCreateSequenceStrings(
 
jdbcEnvironment.getQualifiedObjectNameFormatter().format( 
sequence.getName(), dialect ),
                 sequence.getInitialValue(),
                 sequence.getIncrementSize()
         ),
         formatter,
         options,
         targets
);

With the default implementation this results in a 
org.hibernate.MappingException: org.hibernate.dialect.FirebirdDialect 
does not support pooled sequences (or at least: not by specifying it in 
the DDL).

I'd like to know if I should just override
protected String getCreateSequenceString(String sequenceName, int 
initialValue, int incrementSize)

and ignore the initialValue and incrementSize and just return the result 
of getCreateSequenceString(sequenceName)

or if I should change the above code to call the deprecated(!) method 
getCreateSequenceStrings(String sequenceName) is 
supportsPooledSequences() is false:

dialect.supportsPooledSequences()
	? dialect.getCreateSequenceStrings(
 
jdbcEnvironment.getQualifiedObjectNameFormatter().format( 
sequence.getName(), dialect ),
                 sequence.getInitialValue(),
                 sequence.getIncrementSize()
         ) : dialect.getCreateSequenceStrings(
 
jdbcEnvironment.getQualifiedObjectNameFormatter().format( 
sequence.getName(), dialect )
         ),

Kind regards,
Mark Rotteveel
-- 
Mark Rotteveel


More information about the hibernate-dev mailing list