mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-10433 - Fix hbm2ddl utils has a problem - release jdbc connection
This commit is contained in:
parent
977c34bb59
commit
d35e29dc29
@ -130,7 +130,12 @@ public void execute(Target target) {
|
||||
);
|
||||
}
|
||||
|
||||
schemaMigrator.doMigration( metadata, databaseInformation, true, toolTargets );
|
||||
try {
|
||||
schemaMigrator.doMigration( metadata, databaseInformation, true, toolTargets );
|
||||
}
|
||||
finally {
|
||||
databaseInformation.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
private List<org.hibernate.tool.schema.spi.Target> buildToolTargets(Target target) {
|
||||
|
@ -86,9 +86,13 @@ public void validate() {
|
||||
"Error creating DatabaseInformation for schema validation"
|
||||
);
|
||||
}
|
||||
|
||||
serviceRegistry.getService( SchemaManagementTool.class ).getSchemaValidator( cfgService.getSettings() )
|
||||
.doValidation( metadata, databaseInformation );
|
||||
try {
|
||||
serviceRegistry.getService( SchemaManagementTool.class ).getSchemaValidator( cfgService.getSettings() )
|
||||
.doValidation( metadata, databaseInformation );
|
||||
}
|
||||
finally {
|
||||
databaseInformation.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -152,4 +152,9 @@ public SequenceInformation locateSequenceInformation(QualifiedSequenceName seque
|
||||
|
||||
return sequenceInformationMap.get( sequenceName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup() {
|
||||
extractionContext.cleanup();
|
||||
}
|
||||
}
|
||||
|
@ -96,6 +96,7 @@ public DatabaseObjectAccess getDatabaseObjectAccess() {
|
||||
return registeredTableAccess;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup() {
|
||||
if ( jdbcDatabaseMetaData != null ) {
|
||||
jdbcDatabaseMetaData = null;
|
||||
|
@ -101,4 +101,6 @@ public SequenceInformation getSequenceInformation(
|
||||
* @return {@code true} indicates a catalog with the given name already exists
|
||||
*/
|
||||
boolean catalogExists(Identifier catalog);
|
||||
|
||||
void cleanup();
|
||||
}
|
||||
|
@ -40,4 +40,6 @@ interface DatabaseObjectAccess {
|
||||
}
|
||||
|
||||
DatabaseObjectAccess getDatabaseObjectAccess();
|
||||
|
||||
void cleanup();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user