You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that a transaction using the + append annotation will fail when a map is supplied. For reference, I'm using Asami 2.2.1 and Clojure 1.10.3.855.
(defconn (d/connect"asami:local://demo"))
#'hue.server.core/conn
(d/transact conn [{:title"Demo":description"This is a demonstration of the append annotation failing on maps.":contents [{:statement"Wow"}]}])
#object[java.util.concurrent.CompletableFuture 0x4e0964bb"java.util.concurrent.CompletableFuture@4e0964bb[Completed normally]"]
(d/entity (d/db conn) (asami.graph/new-node1))
{:title"Demo",
:description"This is a demonstration of the append annotation failing on maps.",
:contents [{:statement"Wow"}]}
(d/transact conn [{:db/id (asami.graph/new-node1)
:contents+ {:statement"What?"}}])
; Execution error (IllegalArgumentException) at asami.durable.encoder/eval22954$fn$G (encoder.clj:107).; No implementation of method: :encapsulate-id of protocol: #'asami.durable.encoder/FlatFile found for class: clojure.lang.PersistentArrayMap
As FlatFile does not implement the encapsulate-id function for IPersistentMap, this error seems like expected behavior (or temporary).
;; If this is an identified object, then save it's location
(doseq [id-attr [:db/id:db/ident:id]]
(when-let [id (id-attr this)]
(vswap! *entity-offsets* assoc id @*current-offset*)))
(body (apply concat (seq this))))
If it's the case, how can I append a map to a vector? I could use the ' replacement annotation and set the vector as its previous items with the new one appended, but it seems inefficient and unintended.
The text was updated successfully, but these errors were encountered:
IPersistentMap was the wrong thing to have here, and it's been fixed, but it's not the cause of this problem. In this case, there appears to be a missing code path for adding a map to the sequence (unless it's to be saved as a map object, but this isn't what the API is supposed to do here).
The latest version will actually save this map as a "value" in the list, which isn't consistent either. I'll see if I can track down where this is happening in the entity writer code.
It seems that a transaction using the
+
append annotation will fail when a map is supplied. For reference, I'm using Asami2.2.1
and Clojure1.10.3.855
.As
FlatFile
does not implement theencapsulate-id
function forIPersistentMap
, this error seems like expected behavior (or temporary).asami/src/asami/durable/encoder.clj
Lines 333 to 341 in d3b6752
If it's the case, how can I append a map to a vector? I could use the
'
replacement annotation and set the vector as its previous items with the new one appended, but it seems inefficient and unintended.The text was updated successfully, but these errors were encountered: