简体   繁体   English

如果从 cqlsh 而不是使用 DistributedTransaction 输入一行,则 tx 字段的值应该是多少

[英]what should be the values of tx fields if a row is entered from cqlsh instead from using DistributedTransaction

In ScalarDB , what should be the values of tx fields if a row is entered from cqlsh instead from using DistributedTransaction ?ScalarDB中,如果从cqlsh而不是使用DistributedTransaction输入一行,则 tx 字段的值应该是多少?

My table's schema is我的表的架构是

CREATE TABLE codingjedi.supported_tags (
    course text,
    subject text,
    topic text,
    before_tx_committed_at bigint,
    before_tx_id text,
    before_tx_prepared_at bigint,
    before_tx_state int,
    before_tx_version int,
    tx_committed_at bigint,
    tx_id text,
    tx_prepared_at bigint,
    tx_state int,
    tx_version int,
    PRIMARY KEY (course, subject, topic)
)

I populated some entries in the table from cqlsh directly INSERT INTO supported_tags (course, subject, topic) VALUES ('coding','Perl','empty' ) IF NOT EXISTS;我直接从cqlsh填充了表中的一些条目INSERT INTO supported_tags (course, subject, topic) VALUES ('coding','Perl','empty' ) IF NOT EXISTS;

But this leaves tx_committed_at tx_id, tx_prepared_at, tx_state, tx_version null .但这留下tx_committed_at tx_id, tx_prepared_at, tx_state, tx_version null I think this is causing issue when I do a get .我认为这在我执行get时会引起问题。 I get an exception invalid id specified.. Cause: null .我得到一个异常invalid id specified.. Cause: null

Can I add rows in table from cqlsh ?我可以从cqlsh在表中添加行吗?

It's not recommended.不建议这样做。 There is no guarantee of Scalar DB transaction.不保证 Scalar DB 事务。 It is better to populate records via Scalar DB transaction.最好通过 Scalar DB 事务填充记录。

I have never tried that.我从来没有尝试过。 I guess that you can set 3 (which means committed ) to tx_state , an integer value to tx_version , a bigint number to tx_*_at , and a string to tx_id .我想您可以将3 (表示已committed )设置为tx_state ,将 integer 值设置为tx_version ,将 bigint 数字设置为tx_*_at ,将字符串设置为tx_id

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM