@Override
public void write(MarshalledEntry entry) {
Connection connection = null;
String keyStr = key2Str(entry.getKey());
try {
connection = connectionFactory.getConnection();
write(entry, connection, keyStr, getSegment(entry));
} catch (SQLException ex) {
log.sqlFailureStoringKey(keyStr, ex);
throw new PersistenceException(String.format("Error while storing string key to database; key: '%s'", keyStr), ex);
} catch (InterruptedException e) {
if (trace) {
log.trace("Interrupted while marshalling to store");
}
Thread.currentThread().interrupt();
} finally {
connectionFactory.releaseConnection(connection);
}
}