You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Priyanka Gugale <pr...@datatorrent.com> on 2016/04/05 10:51:49 UTC

Lightweight transaction for read and update

Hi,

Is there a possibility that we can write a cql statement which can *read a
column value and update it in same transaction* (e.g. column has value 28,
I read it add 7 to it and update column value to 35)? There are some
examples for lightweight transactions
<http://docs.datastax.com/en/cassandra/2.0/cassandra/dml/dml_ltwt_transaction_c.html>
but
from this I couldn't figure out how do I achieve read and update in same
statement.

-Priyanka

Re: Lightweight transaction for read and update

Posted by Priyanka Gugale <pr...@datatorrent.com>.
Okay thanks for revert.

-Priyanka

On Tue, Apr 5, 2016 at 2:50 PM, Sylvain Lebresne <sy...@datastax.com>
wrote:

> No, this is currently not possible. This is something that is
> likely technically feasible with the LWT mechanism but it
> is not currently supported (and, for info, is not on anyone
> short term todo list as far as I know).
>
> Sorry.
>
> On Tue, Apr 5, 2016 at 10:51 AM, Priyanka Gugale <priyanka@datatorrent.com
> >
> wrote:
>
> > Hi,
> >
> > Is there a possibility that we can write a cql statement which can *read
> a
> > column value and update it in same transaction* (e.g. column has value
> 28,
> > I read it add 7 to it and update column value to 35)? There are some
> > examples for lightweight transactions
> > <
> >
> http://docs.datastax.com/en/cassandra/2.0/cassandra/dml/dml_ltwt_transaction_c.html
> > >
> > but
> > from this I couldn't figure out how do I achieve read and update in same
> > statement.
> >
> > -Priyanka
> >
>

Re: Lightweight transaction for read and update

Posted by Sylvain Lebresne <sy...@datastax.com>.
No, this is currently not possible. This is something that is
likely technically feasible with the LWT mechanism but it
is not currently supported (and, for info, is not on anyone
short term todo list as far as I know).

Sorry.

On Tue, Apr 5, 2016 at 10:51 AM, Priyanka Gugale <pr...@datatorrent.com>
wrote:

> Hi,
>
> Is there a possibility that we can write a cql statement which can *read a
> column value and update it in same transaction* (e.g. column has value 28,
> I read it add 7 to it and update column value to 35)? There are some
> examples for lightweight transactions
> <
> http://docs.datastax.com/en/cassandra/2.0/cassandra/dml/dml_ltwt_transaction_c.html
> >
> but
> from this I couldn't figure out how do I achieve read and update in same
> statement.
>
> -Priyanka
>