Fork me on GitHub
Joe Lane00:02:35

Is there any way to emulate the behavior of the tx-report-queue in this code snippet with datomic-cloud?

(defn react-on-transactions! [conn]
  (let [tx-queue (d/tx-report-queue conn)]
      (while true
        (let [txn (.take tx-queue)]
            (when (:tx-data txn)
              (on-transaction txn))
            (catch Exception e
              (log/error e "There was an error diring processing of datomic transaction"))))))))
I really like the idea of being able to subscribe to transactions but I read that with datomic cloud only the client api is supported.

Joe Lane01:02:12

So I read above, found the approach that @luchini was suggested with tx-log and I’m going through searching for usages of tx-log. Maybe polling for transactions since the last basis-t is the best approach here.


Is there anyway to speculativly transact fixtures into a db using d/withthat a transaction function can be tested with?


If I understand your question correctly, yes, just do what you would do with transact


Am probably doing it wrong. trying to test "updating" (via cas); Using d/with, sending in the fixture, then attempting to test my client update fn (that does a transact)


nm, sorted it; was using a combination of ideas from two different blog posts and got confused


thanks @val_waeselynck, sorry for the noise 🙂


Hey folks. Is it possible to store small data structures as values without converting them to a byte array or string? For instance

[?entity-id :some/attribute {:a 1 :b 2} ?transaction_id]


If so, what is the :db/valueType to use for such a thing? (The lack of an obvious answer to that makes me think that I would have to convert to byte array or string).


@chrjs not possible at present, but there are probably feature requests for that. My approach is to serialize as EDN, JSON or Fressian, my choice depending of the requirements in terms of availability, speed and readability of these various formats


Ok, great, thanks @val_waeselynck :thumbsup:


Has anyone standing up or updating a recent on-prem-flavor CloudFormation stack run into this: instances refuse to converge, stopping right at launch, and in the system log is

Cloud-init v. 0.7.6 finished at Thu, 01 Feb 2018 19:30:16 +0000. Datasource DataSourceEc2.  Up 18.22 seconds
mount: special device /dev/sdb does not exist
Stopping sshd:  [  OK  ]


After which the datomic .zip gets downloaded successfully, but appears to silently die and then the machine begins orderly shutdown


Not sure if is failing or the box is just kindly letting the download finish while stopping


@chris_johnson the most common cause of transactor startup failure is license expired or key put in improperly


It looks correct but I am re-building the template JSON “from scratch” just to make sure


and you’re certain your license is valid for the version you’re running?


you can test it by trying to launch that same version locally with the same properties file


*by same i mean of course with a different storage 🙂


however, if you have AWS creds locally, you could also run a local transactor against your Dynamo storage to make sure that all works as well


@marshall Who do I talk to if I think a license should be valid for the latest version of Datomic Pro and the license validator disagrees? 😇


that would be me 🙂 Can you send me an email?


what's the most efficient way of returning the last 10 transactions for a particular query?


@U2JACTBMX what does it mean for a transaction to be 'for' a query?


Sorry if I seem unclear, I'm still getting the hang of Datomic. Let's say I have an attribute that is of db.type/ref and cardinality of many. How can I efficiently retrieve the most recently transacted datoms for this attribute in some entity that I've also queried for. That is to say the most recently added edges from entity A (one that was selected for in the query) to the other entities pointed to by the ref type attribute


@U2JACTBMX you can retrieve all the datoms for that entity and attribute with (d/datoms (d/history db) eavt my-eid my-attr), or in Datalog (d/q [:find [?e ?a ?v ?t ?op] :in $h ?e ?a :where [$h ?e ?a ?v ?t ?op]] (d/history db) my-eid my-attr)


@val_waeselynck I'll try that out. Thank you!