In short:
Environment:
PHP 7.0.6 (cli) (built: Apr 28 2016 22:35:28) ( NTS )
[cqlsh 4.1.1 | Cassandra 2.0.17 | CQL spec 3.1.1 | Thrift protocol 19.39.0]
Code:
$builder = \Cassandra::cluster();
$cluster = $builder->withContactPoints('host.lv')
->withCredentials('user', 'password')
->build();
$builder2 = \Cassandra::cluster();
$cluster2 = $builder2->withContactPoints('host.lv')
->withCredentials('user', 'password')
->build();
$session = $cluster->connect('some_keyspace');
This code snippet raises this error:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Magick: abort due to signal 6 (SIGABRT) "Abort"...
Aborted
Seems to build 2 sessions I should use this:
$builder->withPersistentSessions(false);
But can you please fix this to raise php exception in this case not the "magic" error?