51,10 → 51,11 |
* Move event table data to snapshot |
*/ |
|
Connection con = null; |
Connection fcon = null; |
try { |
con = pool.getConnection(); |
|
try( Connection con = pool.getConnection(); |
Connection fcon = fpool.getConnection(); |
) { |
|
con.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE); |
con.setAutoCommit(false); |
Statement stmt = con.createStatement(); |
65,7 → 66,7 |
con.commit(); //all events moved from tbl_events to tbl_events_snap at this point |
|
|
fcon = fpool.getConnection(); |
|
PreparedStatement errorPrepSql = fcon.prepareStatement(moveErrorSQL); |
|
PreparedStatement del = con.prepareStatement(deleteSQL); |
83,7 → 84,8 |
long event_ts = rs.getLong(6); |
boolean bretry = false; |
|
SimpleSoap ss = new SimpleSoap( url, id, IOUtils.toString(c.getCharacterStream())); |
//SimpleSoap ss = new SimpleSoap( url, id, IOUtils.toString(c.getAsciiStream()c.getCharacterStream())); |
SimpleSoap ss = new SimpleSoap(url, id, c.getSubString(1L, (int) c.length())); |
int retry = 0; |
Reader response = null; |
String rsp = ""; |
152,14 → 154,6 |
} catch (IOException e) { |
log.error("Exception in SQL execution: {}", e.getMessage()); |
throw new RuntimeException(e); |
} finally { |
try { |
if(fcon!=null) fcon.close(); |
if(con!=null) con.close(); |
} catch (SQLException e) { |
log.error("Error closing the database connections: {}", e.getMessage()); |
throw new RuntimeException(e); |
} |
} |
} |
|