After clearing my keyspace via:
drop keyspace simplex
I'm executing the following commands via the datastax java Cassandra client (from scala code):
val songsTable = (
"CREATE TABLE IF NOT EXISTS simplex.songs ("
+ "id uuid PRIMARY KEY,"
+ "title text,"
+ "album text,"
+ "artist text,"
+ "tags set<text>,"
+ "data blob"
+ ");")
val listsTable = (
"CREATE TABLE IF NOT EXISTS simplex.playlists ("
+ "id bigint,"
+ "title text,"
+ "album text, "
+ "artist text,"
+ "song_id uuid,"
+ "PRIMARY KEY (id, title, album, artist)"
+ ");")
val songs = (
"INSERT INTO simplex.songs "
+ "(id, title, album, artist, tags) "
+ "VALUES ("
+ "756716f7-2e54-4715-9f00-91dcbea6cf50,"
+ "'La Petite Tonkinoise',"
+ "'Bye Bye Blackbird',"
+ "'Joséphine Baker',"
+ "{'jazz', '2013'}"
+ ");")
...
...
...
val rsf = session.executeAsync(command) // in parallel
rsf.addListener(() => p.success(rsf.get), exec)
This results in only the playlist table being created, and the callback for the "create songs table" and "insert song" commands never get executed.
It was my understanding that the datastax java Cassandra client was safe to use concurrently. Is this not the case? What is the problem with my assumptions?
command
? (is it the concatenation of those statements?) – Alex Popescus.executeAsync(cmd1); s.executeAsync(cmd2); s.executeAsync(cmd3)
). – jonderryonSuccess
orandThen
. For the record, I found there actually was an error being returned that I didn't properly propagate to the promise, so hanging is not an issue, just the fact that there is an error even when run the following codecreateKeyspaceSimplex onSuccess createTablePlaylists
. I get an exception:Cannot add column family 'playlists' to non existing keyspace 'simplex'.
– jonderry