Uploaded image for project: 'Hibernate ORM'
  1. HHH-10443

SchemaUpdate and SchemaMigration do not release jdbc connection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.6
    • Fix Version/s: 5.1.0, 5.0.8
    • Component/s: hibernate-core
    • Labels:
    • Environment:
      hibernate.cfg.xml hbm2ddl.auto set on update
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

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

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

      	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, 这里使用
      	}
      

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: