Can't update rows values.

38 views
Skip to first unread message

Silvio Iannone

unread,
Dec 3, 2013, 10:38:34 AM12/3/13
to phpc...@googlegroups.com
Hello.

I'm actually using phpcassa with Cassandra 2.0.3 in a project i'm developing.

Everything was working fine until i upgraded to Cassandra 2.0.3, but now something strange happens when i try to insert (modify) some rows.
It looks like that 99% of the time the insert is not completed somehow and i end up with the row containing the old values.

I also tried to edit those rows manually using Cassandra Cluster Admin and in that case it works without problems.

Besides i also noticed that i have no problems in inserting new rows.

Thank you for helping.

Tyler Hobbs

unread,
Dec 3, 2013, 12:52:11 PM12/3/13
to phpc...@googlegroups.com
Can you give an example of what the original row looks like and what your update looks like?  What's your RF and what consistency levels are you using for writes and reads?


--
You received this message because you are subscribed to the Google Groups "phpcassa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpcassa+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Tyler Hobbs
DataStax
Message has been deleted

Silvio Iannone

unread,
Dec 3, 2013, 1:47:36 PM12/3/13
to phpc...@googlegroups.com
E.G.: is what the column looks like

Users{

    
Silvio {

        
Avatar: "avatar.jpg"
    
}
}

And after the insert it looks exactly the same (even thought i get no errors).

Basically this is the code i'm using:

class User {
    
    protected $cassandra; # Cassandra instance
    protected $username;  # Username
    
    function __construct($username){
        
        // Initialize database connection
        $this->cassandra = new ConnectionPool(
                Settings\Database::$keyspace,
                Settings\Database::$serverAddresses
        );
        
        $this->username = $username;
        
    }

    public function changeAvatar($fileName){
        
        $cf = new ColumnFamily($this->cassandra, Settings\Database::$usersCF);
        $cf->insert($this->username, array(
            "Avatar" => strip_tags($fileName)
        ));
    }
}

The RF is 1 and ConsistencyLevel is 1 because i'm using cassandra only on this same machine.

Am i doing something wrong?

Tyler Hobbs

unread,
Dec 3, 2013, 3:36:00 PM12/3/13
to phpc...@googlegroups.com
It looks like you're doing everything correctly, which makes me think it might be a problem with Cassandra.  What version of Cassandra were you on before you upgraded?

Silvio Iannone

unread,
Dec 3, 2013, 3:48:04 PM12/3/13
to phpc...@googlegroups.com
If i'm not mistaken Cassandra's previous version was 1.2 and phpcassa's was 1.0.a.6.

Few minutes ago i also upgraded to phpcassa to version 1.1.0 and at the moment everything seems to work fine.

I'll keep testing it and will let you know if something goes wrong again.

Thank you again :)


2013/12/3 Tyler Hobbs <ty...@datastax.com>

--
You received this message because you are subscribed to a topic in the Google Groups "phpcassa" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phpcassa/KRvEKI-6JwQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phpcassa+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages