Skip to content

Commit

Permalink
[hibernate#2055] Setting hibernate.query.mutation_strategy.global_tem…
Browse files Browse the repository at this point in the history
…porary.create_tables to false has no effect
  • Loading branch information
dreab8 committed Feb 5, 2025
1 parent 42d5c04 commit 634d072
Showing 1 changed file with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,23 @@ default void prepare(MappingModelCreationProcess mappingModelCreationProcess, Jd
if ( !createIdTables ) {
tableCreatedStage.complete( null );
}

LOG.debugf( "Creating global-temp ID table : %s", getTemporaryTable().getTableExpression() );

connectionStage()
.thenCompose( this::createTable )
.whenComplete( (connection, throwable) -> releaseConnection( connection )
.thenAccept( v -> {
if ( throwable == null ) {
setDropIdTables( configService );
tableCreatedStage.complete( null );
}
else {
tableCreatedStage.completeExceptionally( throwable );
}
} )
);
else {
LOG.debugf( "Creating global-temp ID table : %s", getTemporaryTable().getTableExpression() );

connectionStage()
.thenCompose( this::createTable )
.whenComplete( (connection, throwable) -> releaseConnection( connection )
.thenAccept( v -> {
if ( throwable == null ) {
setDropIdTables( configService );
tableCreatedStage.complete( null );
}
else {
tableCreatedStage.completeExceptionally( throwable );
}
} )
);
}
}

private CompletionStage<Void> releaseConnection(ReactiveConnection connection) {
Expand Down

0 comments on commit 634d072

Please sign in to comment.