We're updating the issue view to help you get more done. 

NPE in SchemaValidator with DdlTransactionIsolatorJtaImpl

Description

Looks like SchemaValidatorImpl.doValidation() fails to properly call DdlTransactionIsolator.prepare()/release(), therefore the connection is null.

Acqiuire:

1 2 3 4 5 6 7 8 9 10 11 DdlTransactionIsolatorJtaImpl.getIsolatedConnection() line: 65 ImprovedExtractionContextImpl.getJdbcConnection() line: 60 SequenceInformationExtractorLegacyImpl.extractMetadata(ExtractionContext) line: 40 ImprovedDatabaseInformationImpl.initializeSequences() line: 64 ImprovedDatabaseInformationImpl.<init>(ServiceRegistry, JdbcEnvironment, DdlTransactionIsolator, Namespace$Name) line: 58 Helper.buildDatabaseInformation(ServiceRegistry, DdlTransactionIsolator, Namespace$Name) line: 126 SchemaValidatorImpl.doValidation(Metadata, ExecutionOptions) line: 55 SchemaManagementToolCoordinator.performDatabaseAction(Action, Metadata, SchemaManagementTool, ServiceRegistry, ExecutionOptions) line: 184 SchemaManagementToolCoordinator.process(Metadata, ServiceRegistry, Map, DelayedDropRegistry) line: 65 SessionFactoryImpl.<init>(MetadataImplementor, SessionFactoryOptions) line: 307 SessionFactoryBuilderImpl.build() line: 490

NPE:

1 2 3 4 5 6 7 8 9 SequenceInformationExtractorLegacyImpl.extractMetadata(ExtractionContext) line: 40 ImprovedDatabaseInformationImpl.initializeSequences() line: 64 ImprovedDatabaseInformationImpl.<init>(ServiceRegistry, JdbcEnvironment, DdlTransactionIsolator, Namespace$Name) line: 58 Helper.buildDatabaseInformation(ServiceRegistry, DdlTransactionIsolator, Namespace$Name) line: 126 SchemaValidatorImpl.doValidation(Metadata, ExecutionOptions) line: 55 SchemaManagementToolCoordinator.performDatabaseAction(Action, Metadata, SchemaManagementTool, ServiceRegistry, ExecutionOptions) line: 184 SchemaManagementToolCoordinator.process(Metadata, ServiceRegistry, Map, DelayedDropRegistry) line: 65 SessionFactoryImpl.<init>(MetadataImplementor, SessionFactoryOptions) line: 307 SessionFactoryBuilderImpl.build() line: 490

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Moritz Bechler

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.2.2

Priority

Major