Orange-OpenSource / YACassandraPDO

Cassandra PDO Driver fork
Apache License 2.0
85 stars 32 forks source link

Error on inserts - "no keyspace has been specified" #78

Closed khandelwalneeraj closed 9 years ago

khandelwalneeraj commented 9 years ago

We have a worker which keeps writing to Cassandra whenever it receives a request to do so. The situation is really weird as we are doing inserts in loop and while many of the inserts succeed but few fails with no keyspace has been specified. There is nothing suspicious in logs.

This is how we are making connection

$dsn = "cassandra:host=somehost;port:someport,host=somehost2;port:someport2";
$cassandra = new PDO($dsn, $username, $password, array(PDO::ATTR_PERSISTENT));

For keyspace we execute a query $cassandra->exec("USE keyspace;");

We now assign $cassandra to a static class variable which is used for the inserts. Additionally, we have not specified timeout and the worker never dies as it is added in supervisor. We also have other keyspaces.

So I have two question:

khandelwalneeraj commented 9 years ago

This seems sorted.