27
27
28
28
public interface ReactiveGlobalTemporaryTableStrategy {
29
29
30
- Log LOG = make ( Log .class , lookup () );
31
-
32
30
static String sessionIdentifier (SharedSessionContractImplementor session ) {
33
31
return session .getSessionIdentifier ().toString ();
34
32
}
@@ -65,22 +63,23 @@ default void prepare(MappingModelCreationProcess mappingModelCreationProcess, Jd
65
63
if ( !createIdTables ) {
66
64
tableCreatedStage .complete ( null );
67
65
}
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
+ }
84
83
}
85
84
86
85
private CompletionStage <Void > releaseConnection (ReactiveConnection connection ) {
@@ -103,7 +102,7 @@ private CompletionStage<Void> releaseConnection(ReactiveConnection connection) {
103
102
104
103
private static void logConnectionClosedError (Throwable t ) {
105
104
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 () );
107
106
}
108
107
}
109
108
@@ -147,24 +146,25 @@ default void release(
147
146
if ( !isDropIdTables () ) {
148
147
tableDroppedStage .complete ( null );
149
148
}
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
+ }
168
168
}
169
169
170
170
private CompletionStage <ReactiveConnection > dropTable (ReactiveConnection connection ) {
0 commit comments