Fork me on GitHub
#datomic
<
2019-03-01
>
souenzzo00:03:58

(datomic.ion.dev/-main "{:op :push}")

{:command-failed "{:op :push}",
 :causes ({:message "INSTANCE", :class NoSuchFieldError})}

Process finished with exit code 1
Why I can't push from REPL?

souenzzo12:03:42

Bump Context: I'm doing a script that calls push and do some other stuff

tyler00:03:02

Is there something that would cause an ion deployed to a query group to perpetually retrieve a cached db value? I have a deployed ion that I am able to transact with and I am logging the time value of the db-after and any time I call (d/db (conn)). The db-after time is increasing (as expected) after every transaction but I always see the same (d/db (conn)) :t value despite transactions occurring. The only thing that will bring the db up to date is a re-deploy. So far as I can tell Iā€™m not caching anything on my side (the client, connection and d/db are all called without memoization).

marshall02:03:05

This issue was fixed in the latest release

marshall02:03:35

I would recommend updating to it and seeing if that helps

tyler14:03:48

Problem solved, thanks marshall.

tyler00:03:01

Eventually it seems to pick up a fresh :t but it takes ~5 mins to do so.

tyler02:03:16

Another data point to add is when I try to query against the :db-after of a transaction I get exceptions like Database does not yet have t=257. Is this expected? From the docs on this page https://docs.datomic.com/cloud/whatis/client-synchronization.html it would seem like the latency should be less then a second before being able to query against the new value but Iā€™m seeing latencies on the order of minutes.

Piotr08:03:00

Hi, I wonder what is it that I am doing wrong:

(def limited
  (let [sdb (db/db)
        mess (d/q {:query '[:find ?mc
                            :where
                            [?e :message/content ?mc]]
                   :args [sdb]
                   :limit 2
                   :offset 0})]
    mess))

(def non-limited
  (let [sdb (db/db)
        mess (d/q '[:find ?mc
                    :where
                    [?e :message/content ?mc]]
                  sdb)]
    mess))
The limited one will complain that find clause does not exist. All I want to do is to read data in chunks.
1. Caused by java.lang.IllegalArgumentException
   No :find clause specified

mdhaney09:03:22

All the variables in the :where clauses that arenā€™t part of the :find clause will be unified. Since you only have 1 :where clause, there is nothing for ?e to unify with. Replacing ?e with a _ (underscore) should fix it.

Piotr11:03:28

@U0JPBB10W did you mean this:

(def limited
  (let [sdb (db/db)
        mess (d/q {:query '[:find ?mc
                            :where
                            [_ :message/content ?mc]]
                   :args [sdb]
                   :limit 2
                   :offset 0})]
    mess))

still no luck

Piotr11:03:12

1. Caused by java.lang.IllegalArgumentException
   No :find clause specified

benoit13:03:06

@UBC1Y2E01 What API are you using? client (`datomic.client.api`) or peer (`datomic.api`)?

benoit13:03:05

It looks like you might be passing the argument map of the client api to the peer api.

Piotr14:03:26

I use datomic.api

Piotr14:03:44

@U963A21SL I think I know what is going on. I use q, but it looks like I should be using query from datomic.api as in here: https://docs.datomic.com/on-prem/clojure/index.html#datomic.api/q Thanks for pointing me in the right direction!

benoit14:03:44

Ok. The datomic.api does not support :limit and :offset according to the doc.

Piotr14:03:40

Yes, I will figure out another way šŸ™‚ Thanks!

Brian Abbott15:03:30

I think it is from Cognitect directly

Brian Abbott15:03:55

I would be cool if it could host pointers to other Datomic videos and chats as well... maybe through playlists?

Brian Abbott15:03:12

It looks really old though - 6 years ago

Alex Miller (Clojure team)15:03:43

I'm not sure if that is official stuff or not. the most recent official series of datomic videos is at https://www.youtube.com/playlist?list=PLZdCLR02grLoMy4TXE4DZYIuxs3Q9uc4i

4
Alex Miller (Clojure team)16:03:22

and clojuretv has many clojure conference videos about datomic https://www.youtube.com/user/ClojureTV/search?query=datomic

okocim19:03:16

Is there an idiomatic way to ā€œabandonā€ a transaction from within a transaction function? Say I am processing an external update feed, and in so doing, I want to go ahead and transact the message from a feed only if the message represents data that is more current than whatā€™s in the db. If I return an empty list, a transaction still happens, which is fine, but Iā€™m not sure what the implications are of adding an empty transaction to the system.

benoit20:03:11

@okocim Throwing will cancel the transaction.

okocim20:03:05

šŸ˜… thanks

mdhaney20:03:59

I think @okocim question is due to a problem with the documentation. The on-prem docs mention throwing an exception from a transaction function to abort the transaction, but I found no mention of it in the Cloud docs. I had to ask on here a few weeks ago if it still works for Cloud. I think an update to the Cloud docs would be useful.

tim22:03:03

Does Datomic support on-prem (with non-hosted storage) capability to evolve from a single node to a cluster as the need arises?

tim22:03:02

As I understand it, this was not supported, but I havenā€™t followed all the changes.

johnj22:03:16

you can't do distributed writes if that is what you mean

tim22:03:09

No, If I remember correctly the team said itā€™s not ok to have the transactor and the storage on the same nodeā€¦. Itā€™s been a long time since Iā€™ve looked at all this..

johnj23:03:46

that's only (my guess) because you don't want both fighting for the same resources, but then, I don't understand what your asking, by node, you mean a transactor?

tim23:03:37

no by node I mean server. I just remembered why I couldnā€™t use datomicā€¦ I would need to support customers whom only want to run a single db server node, but may need to evolve. I was somehow hoping Datomic was capable of this, but Iā€™m now remembering this was not a good fit.

favila23:03:43

what is a "single db server node"?

tim19:03:11

I have many customers. I need a model where each can have their own DB and for that DB to be isolated to a single machine on my network. At the same time some customers may require their data to exist in house (their house), but are not going to be interested in managing a cluster (particularly at the start).

tim19:03:31

Essentially, Datomic is a good fit for my product as an SAAS, but when it comes to client installs, itā€™s too much. And I would rather choose a DB that can support both models so that I am not doubling my efforts.

favila20:03:49

Dev transactor isnā€™t good enough for in-house use?

favila20:03:48

You might even be able to use the free datomic (check the license)

tim21:03:05

The name Dev alone doesnā€™t give me a good feeling for a production install which is why I asked if it was a supported model. btw, thnx for the responses.

tim21:03:04

Iā€™ll look into the free version, I remember it was once memory only, but I think they changed thatā€¦ thnx

favila00:03:25

Dev = transactor itself serves an embedded h2 (sql) db. This is the same as the ā€œfreeā€ storage

favila00:03:15

We use it internally for a shared staging server. Itā€™s fine

favila00:03:14

If you exceed what that can handle then you should have a separate storage anyway. Even a MySQL server can be used

favila00:03:51

You need to get an estimate of your read and write capacity

tim00:03:36

I see, that really helps, so thnx. As for capacity itā€™ll depend on each client and their data so that would need to be assessed at install time, but that would be the case with any db.

favila23:03:03

you mean they want their data in a different storage?

favila23:03:43

the limitation with datomic is that a transactor cannot manage multiple storages

favila23:03:32

so if you want different datomic dbs to be segregated at the storage level (e.g. different sql tables), you need at least one transactor per each storage

favila23:03:19

but one storage can have many datomic dbs in it, and can have multiple transactors connecting to it (one will be active and the rest will be hot spares), and can have as many peers as your storage can handle

favila23:03:05

does that clarify @tim792?