Fork me on GitHub
#datomic
<
2018-02-01
>
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)]
    (thread
      (while true
        (let [txn (.take tx-queue)]
          (try
            (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 https://github.com/cognitect-labs/day-of-datomic-cloud searching for usages of tx-log. Maybe polling for transactions since the last basis-t is the best approach here.

mgrbyte14:02:45

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

val_waeselynck14:02:01

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

mgrbyte15:02:00

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)

mgrbyte16:02:07

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

mgrbyte21:02:18

thanks @val_waeselynck, sorry for the noise 🙂

chrjs17:02:29

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]

chrjs17:02:50

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).

val_waeselynck17:02:20

@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

chrjs17:02:46

Ok, great, thanks @val_waeselynck :thumbsup:

chris_johnson19:02:31

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  ]

chris_johnson19:02:04

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

chris_johnson19:02:35

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

marshall19:02:41

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

chris_johnson19:02:39

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

marshall19:02:00

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

marshall19:02:11

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

marshall20:02:49

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

marshall20:02:19

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

chris_johnson20:02:53

@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? 😇

marshall20:02:13

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

dbernal21:02:38

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

val_waeselynck08:02:48

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

dbernal14:02:08

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

val_waeselynck14:02:14

@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)

dbernal14:02:16

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