SchemaUpdate and SchemaMigration do not release jdbc connection

Description

DatabaseInformationImpl -> extractionContext variable never release.
cause a jdbc connection leak.

在 DatabaseInformationImpl 类中的 extractionContext 变量在使用完成后没有释放,导致 Jdbc 连接泄露.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 public DatabaseInformationImpl( ServiceRegistry serviceRegistry, JdbcEnvironment jdbcEnvironment, JdbcConnectionAccess jdbcConnectionAccess, Identifier defaultCatalogName, Identifier defaultSchemaName) throws SQLException { this.jdbcEnvironment = jdbcEnvironment; this.extractionContext = new ExtractionContextImpl( serviceRegistry, jdbcEnvironment, jdbcConnectionAccess, this, defaultCatalogName, defaultSchemaName ); // the make , 这里构造 // todo : make this pluggable this.extractor = new InformationExtractorJdbcDatabaseMetaDataImpl( extractionContext ); // legacy code did initialize sequences... initializeSequences(); // the use, 这里使用 }

Environment

hibernate.cfg.xml hbm2ddl.auto set on update

Status

Assignee

Andrea Boriero

Reporter

ykp

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.6

Priority

Major