Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed persistence to default true + getclient fix

  • Loading branch information...
commit e4d60e72c27ac615c050b0951e6ac7fe53f47cfb 1 parent 9779159
@mjpearson authored
View
2  config.php
@@ -12,7 +12,7 @@
define('SCHEMA_PATH', dirname(__FILE__).'/schemas/');
define('THRIFT_PORT_DEFAULT', 9160);
define('DEFAULT_ROW_LIMIT', 10);
-define('PERSIST_CONNECTIONS', FALSE); // TSocket Persistence
+define('PERSIST_CONNECTIONS', TRUE); // TSocket Persistence
define('CASSANDRA_CONF_PATH', '/usr/local/src/apache-cassandra-0.6.1/conf/storage-conf.xml');
require_once dirname(__FILE__).'/lib/loader.php';
View
4 examples/address_supercolumn.php
@@ -90,4 +90,6 @@ public function init() {
// Show the JSON for our CF with cloned data. This and the prior echo should match
echo '<pre>'.$addrsClone->toJSON(TRUE).'</pre>';
-?>
+
+PandraCore::disconnectAll();
+?>
View
6 lib/Core.class.php
@@ -320,6 +320,8 @@ static public function auto($host, $poolName = self::DEFAULT_POOL_NAME, $port =
new TBinaryProtocol($transport)));
$tokenMap = $client->get_string_property('token map');
+ $transport->close();
+ unset($transport); unset($client);
$tokens = json_decode($tokenMap);
foreach ($tokens as $token => $host) {
if (!self::connect($token, $host, $poolName)) {
@@ -427,7 +429,9 @@ static public function getClient($writeMode = FALSE) {
// check connection is open
try {
- self::$_socketPool[self::$_activePool][self::$_activeNode]['transport']->open();
+ if (!self::$_socketPool[self::$_activePool][self::$_activeNode]['transport']->isOpen()) {
+ self::$_socketPool[self::$_activePool][self::$_activeNode]['transport']->open();
+ }
return $conn;
} catch (TException $te) {
Please sign in to comment.
Something went wrong with that request. Please try again.