Skip to content

Commit

Permalink
Just move private method
Browse files Browse the repository at this point in the history
  • Loading branch information
yma96 committed Oct 23, 2024
1 parent 8d968db commit f261793
Showing 1 changed file with 32 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,37 +131,6 @@ public void init()
logger.info( "-- Cassandra Folo Records Keyspace and Tables created" );
}

private ResultSet executeSession ( BoundStatement bind )
{
boolean exception = false;
ResultSet trackingRecord = null;
try
{
if ( session == null || session.isClosed() )
{
client.close();
client.init();
this.init();
}
trackingRecord = session.execute( bind );
}
catch ( NoHostAvailableException e )
{
exception = true;
logger.error( "Cannot connect to host, reconnect once more with new session.", e );
}
finally
{
if ( exception )
{
client.close();
client.init();
this.init();
trackingRecord = session.execute( bind );
}
}
return trackingRecord;
}
public boolean recordArtifact( TrackedContentEntry entry ) throws ContentException, IndyWorkflowException
{

Expand Down Expand Up @@ -436,4 +405,36 @@ public void createDtxTrackingRecord( DtxTrackingRecord trackingRecord )
trackingMapper.save( trackingRecord );
}

private ResultSet executeSession ( BoundStatement bind )
{
boolean exception = false;
ResultSet trackingRecord = null;
try
{
if ( session == null || session.isClosed() )
{
client.close();
client.init();
this.init();
}
trackingRecord = session.execute( bind );
}
catch ( NoHostAvailableException e )
{
exception = true;
logger.error( "Cannot connect to host, reconnect once more with new session.", e );
}
finally
{
if ( exception )
{
client.close();
client.init();
this.init();
trackingRecord = session.execute( bind );
}
}
return trackingRecord;
}

}

0 comments on commit f261793

Please sign in to comment.