2727
2828public interface ReactiveGlobalTemporaryTableStrategy {
2929
30- Log LOG = make ( Log .class , lookup () );
31-
3230 static String sessionIdentifier (SharedSessionContractImplementor session ) {
3331 return session .getSessionIdentifier ().toString ();
3432 }
@@ -65,22 +63,23 @@ default void prepare(MappingModelCreationProcess mappingModelCreationProcess, Jd
6563 if ( !createIdTables ) {
6664 tableCreatedStage .complete ( null );
6765 }
68-
69- LOG .debugf ( "Creating global-temp ID table : %s" , getTemporaryTable ().getTableExpression () );
70-
71- connectionStage ()
72- .thenCompose ( this ::createTable )
73- .whenComplete ( (connection , throwable ) -> releaseConnection ( connection )
74- .thenAccept ( v -> {
75- if ( throwable == null ) {
76- setDropIdTables ( configService );
77- tableCreatedStage .complete ( null );
78- }
79- else {
80- tableCreatedStage .completeExceptionally ( throwable );
81- }
82- } )
83- );
66+ else {
67+ make ( Log .class , lookup () ).debugf ( "Creating global-temp ID table : %s" , getTemporaryTable ().getTableExpression () );
68+
69+ connectionStage ()
70+ .thenCompose ( this ::createTable )
71+ .whenComplete ( (connection , throwable ) -> releaseConnection ( connection )
72+ .thenAccept ( v -> {
73+ if ( throwable == null ) {
74+ setDropIdTables ( configService );
75+ tableCreatedStage .complete ( null );
76+ }
77+ else {
78+ tableCreatedStage .completeExceptionally ( throwable );
79+ }
80+ } )
81+ );
82+ }
8483 }
8584
8685 private CompletionStage <Void > releaseConnection (ReactiveConnection connection ) {
@@ -103,7 +102,7 @@ private CompletionStage<Void> releaseConnection(ReactiveConnection connection) {
103102
104103 private static void logConnectionClosedError (Throwable t ) {
105104 if ( t != null ) {
106- LOG .debugf ( "Ignoring error closing the connection: %s" , t .getMessage () );
105+ make ( Log . class , lookup () ) .debugf ( "Ignoring error closing the connection: %s" , t .getMessage () );
107106 }
108107 }
109108
@@ -147,24 +146,25 @@ default void release(
147146 if ( !isDropIdTables () ) {
148147 tableDroppedStage .complete ( null );
149148 }
150-
151- setDropIdTables ( false );
152-
153- final TemporaryTable temporaryTable = getTemporaryTable ();
154- LOG .debugf ( "Dropping global-tempk ID table : %s" , temporaryTable .getTableExpression () );
155-
156- connectionStage ()
157- .thenCompose ( this ::dropTable )
158- .whenComplete ( (connection , throwable ) -> releaseConnection ( connection )
159- .thenAccept ( v -> {
160- if ( throwable == null ) {
161- tableDroppedStage .complete ( null );
162- }
163- else {
164- tableDroppedStage .completeExceptionally ( throwable );
165- }
166- } )
167- );
149+ else {
150+ setDropIdTables ( false );
151+
152+ final TemporaryTable temporaryTable = getTemporaryTable ();
153+ make ( Log .class , lookup () ).debugf ( "Dropping global-tempk ID table : %s" , temporaryTable .getTableExpression () );
154+
155+ connectionStage ()
156+ .thenCompose ( this ::dropTable )
157+ .whenComplete ( (connection , throwable ) -> releaseConnection ( connection )
158+ .thenAccept ( v -> {
159+ if ( throwable == null ) {
160+ tableDroppedStage .complete ( null );
161+ }
162+ else {
163+ tableDroppedStage .completeExceptionally ( throwable );
164+ }
165+ } )
166+ );
167+ }
168168 }
169169
170170 private CompletionStage <ReactiveConnection > dropTable (ReactiveConnection connection ) {
0 commit comments