Fork me on GitHub
#xtdb
<
2020-07-17
>
Eric Ihli23:07:29

Is it possible to get information about why a transaction wasn't committed? I'm experimenting with adding transaction functions that run specs to validate entities before puts. Do rollbacks leave any trace of what happened?

refset16:07:54

Hi @UJP37GW2K we don't currently expose any means for understanding specifically why a transaction function operation failed, however you can enable logback warn logging for crux.tx to see the function calls and arguments provided. There is an internal atom we use for internal testing that you might be able to hook into, but it's not an official API (so will be highly likely to change without warning in future releases). We might yet add a debug log of the same information. These are lines where the failure is handled: https://github.com/juxt/crux/blob/1b2a05fde2b701a408b8ae5f84bdb5a9270aab0f/crux-core/src/crux/tx.clj#L197-L206

Eric Ihli17:07:38

Awesome. Thanks.

🙏 3