public Set<Integer> loadUserIds(String userid) {
ResultSet result = executeReadQueryWithRetry( m_loadUserIdssStatement.bind(userid));
String string= result.one().getString("ids");
return convertStringToSetOfIntegers(string);
}
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.
Oh, maybe your email client doesn't show the colors. executeReadQueryWithRetry( m_loadUserIdssStatement.bind(userid)). executeReadQueryWithRetry is blue. m_loadUserIdssStatement.bind(userid) is green.Anyway, the method "bind" SOUNDS like it modifies (mutates) the preparedStatement. If what you're saying is true, then it does not in fact modify it; instead, it returns a new object in the current thread. The name is confusing. The documentation should make it clear that it's thread-safe.
Don
OK, here's a further question. I know that BoundStatements are thread safe,
but are they concurrent or do they synchronize behind the scenes and get executed sequentially? I presume they're truly concurrent: multiple threads binding the same PreparedStatement will not interfere.
OK, I misspoke when I said that BoundStatements are thread safe. What I meant was: if multiple threads create different BoundStatement objects from a single PreparedStatement, those objects can safely be used in the respective threads.
My further question is: will the multiple BoundStatement objects created from the single PreparedStatement serialize their activity behind the scenes? I presume not. I presume they're truly concurrent and don't synchronize.