Can anyone tell if this code guarantees all the rows to be inserted right
after all the statements are executed?
IgniteSemaphore semaphore = null;
try {
semaphore =
cacheHolder.getJDBCSemaphore(IgniteLocks.JDBC_LOCK.getLockValue());
semaphore.acquire();
try{
Class.forName("org.apache.ignite.IgniteJdbcThinDriver");
}
catch(Exception e) {
e.printStackTrace();
}
try(final Connection conn =
DriverManager.getConnection(IgniteCacheTable.JDBC_THIN_URL_STRING.toString())){
try (final Statement stmt =
conn.createStatement()) {
stmt.executeUpdate("SET STREAMING ON
ALLOW_OVERWRITE ON");//No I18N
}
try(final PreparedStatement stmt =
conn.prepareStatement(
"INSERT INTO URLS VALUES (?, ?, ?, ?)"))
{//No I18N
while (keys.hasNext()) {
String key = keys.next().toString();
s_id = cacheHolder.getAtomicSequence();
stmt.setLong(1, s_id);
stmt.setString(2, key);
stmt.setDouble(3,
Double.parseDouble(keyValueMap.get(key).toString()));
stmt.setLong(4, appNameId);
stmt.execute();
appNameUrl.put(IgniteCacheTable.FRONTIER_DB.getDBValue()+"|"+objects[1]+"|"+key,
s_id);
}
}
}
}
finally {
if(semaphore != null){
semaphore.release();
}
}
I am having some trouble understanding data consistency when using
IgniteDataStreamers.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/