Asserts - AbstractMethodError [solved]

Hello

When trying out the asserts example from the doc:

(xt/submit-tx
    node
    [(-> (xt/assert-not-exists '(from :users [{:email $email}]))
         (xt/with-op-args [{:email "james@example.com"}]))
     (xt/put :users {:xt/id :james, :email "james@example.com"})])

it throws an error:

1. Unhandled java.lang.AbstractMethodError
   Method
   xtdb/vector/writer$eval39512$fn$reify__39522.listElementWriter()Lxtdb/vector/IVectorWriter;
   is abstract

                writer.clj:   -1  xtdb.vector.writer/eval39512/fn/reify
                writer.clj:  704  xtdb.vector.writer/eval39569/fn
                writer.clj:  692  xtdb.vector.writer/eval39036/fn/G
           tx_producer.clj:   51  xtdb.tx-producer/->xtql-writer/write-xtql!/fn
           tx_producer.clj:   49  xtdb.tx-producer/->xtql-writer/write-xtql!
           tx_producer.clj:  188  xtdb.tx-producer/write-tx-ops!
           tx_producer.clj:  177  xtdb.tx-producer/write-tx-ops!
           tx_producer.clj:  211  xtdb.tx-producer/serialize-tx-ops
           tx_producer.clj:  197  xtdb.tx-producer/serialize-tx-ops
           tx_producer.clj:  227  xtdb.tx-producer.TxProducer/submitTx
                  impl.clj:   60  xtdb.node.impl.Node/submitTxAsync
                   api.clj:  166  xtdb.api/eval26081/fn
             protocols.clj:  692  xtdb.protocols/eval25908/fn/G
                   api.clj:  204  xtdb.api/submit-tx&
                   api.clj:  176  xtdb.api/submit-tx&
                   api.clj:  235  xtdb.api/submit-tx
                   api.clj:  207  xtdb.api/submit-tx
                   api.clj:  233  xtdb.api/submit-tx
                   api.clj:  207  xtdb.api/submit-tx
1 Like

I’ve upgraded to xtdb v2.0.0-20240131.134947-5 released yesterday and happy to report that the new ops :assert-exists and :assert-not-exists now works as advertised.

Thanks!

1 Like

Brilliant, thanks for taking a look again and confirming that :slight_smile:

1 Like