@@ -131,37 +131,6 @@ public void init()
131131 logger .info ( "-- Cassandra Folo Records Keyspace and Tables created" );
132132 }
133133
134- private ResultSet executeSession ( BoundStatement bind )
135- {
136- boolean exception = false ;
137- ResultSet trackingRecord = null ;
138- try
139- {
140- if ( session == null || session .isClosed () )
141- {
142- client .close ();
143- client .init ();
144- this .init ();
145- }
146- trackingRecord = session .execute ( bind );
147- }
148- catch ( NoHostAvailableException e )
149- {
150- exception = true ;
151- logger .error ( "Cannot connect to host, reconnect once more with new session." , e );
152- }
153- finally
154- {
155- if ( exception )
156- {
157- client .close ();
158- client .init ();
159- this .init ();
160- trackingRecord = session .execute ( bind );
161- }
162- }
163- return trackingRecord ;
164- }
165134 public boolean recordArtifact ( TrackedContentEntry entry ) throws ContentException , IndyWorkflowException
166135 {
167136
@@ -436,4 +405,36 @@ public void createDtxTrackingRecord( DtxTrackingRecord trackingRecord )
436405 trackingMapper .save ( trackingRecord );
437406 }
438407
408+ private ResultSet executeSession ( BoundStatement bind )
409+ {
410+ boolean exception = false ;
411+ ResultSet trackingRecord = null ;
412+ try
413+ {
414+ if ( session == null || session .isClosed () )
415+ {
416+ client .close ();
417+ client .init ();
418+ this .init ();
419+ }
420+ trackingRecord = session .execute ( bind );
421+ }
422+ catch ( NoHostAvailableException e )
423+ {
424+ exception = true ;
425+ logger .error ( "Cannot connect to host, reconnect once more with new session." , e );
426+ }
427+ finally
428+ {
429+ if ( exception )
430+ {
431+ client .close ();
432+ client .init ();
433+ this .init ();
434+ trackingRecord = session .execute ( bind );
435+ }
436+ }
437+ return trackingRecord ;
438+ }
439+
439440}
0 commit comments