Coder Social home page Coder Social logo

Feature proposal: Batch revert about ledger HOT 5 OPEN

igordreher avatar igordreher commented on September 16, 2024
Feature proposal: Batch revert

from ledger.

Comments (5)

igordreher avatar igordreher commented on September 16, 2024 2

Hey @gfyrag, thanks for replying!

Do you have seen you can create transactions with multiple postings? Using this instead of multiple transactions could allow you to revert all at once juste by reverting the single transaction you created at first.

Yes and we use it already in some cases. But, we can't revert a single posting of a transaction.

Can you elaborate on your use case?

We are making a wrapper around Ledger with a design that depends on this behavior to guarantee a consistent relation between transactions.
We want to be able to create related transactions atomically and have the option to revert a few of them or revert them all together.
If we use a single transaction with various postings, we wouldn't be able to do this, since I can't revert only a portion of a transaction. We will not be able to undo only e.g. tax or discount (both distinct txids) of a batch transaction using multiple postings as they have the same txid.
And there are moments we would like to revert these atomic transactions all together. If we try to do so, there is a risk this operation fails and can't be completed for reasons such as conflicting transactions happening at the same time.

About the batch not being available on v2, is there any remote possibility that this behavior remains available instead of being replaced? (Adding a bulk endpoint, instead of replacing the current batch endpoint)
I ask this since I'm currently depending on this batch behavior

FYI @lucasfcnunes

from ledger.

lucasfcnunes avatar lucasfcnunes commented on September 16, 2024 1

ping @gfyrag

from ledger.

thiagolinsx avatar thiagolinsx commented on September 16, 2024 1

Nothing?

from ledger.

gfyrag avatar gfyrag commented on September 16, 2024

@igordreher Hello!
Can you elaborate on your use case?
Today, the batch is used mainly to avoid network latencies, not to enforce the commitment of a set of transactions.
The ledger use a single sql transaction, and thus, the whole is either committed or rollback, but this is not the main idea of the batch feature. For your information, we are working on a v2 where the batch will not be available. Instead we will probably implements a bulk request feature. With these bulk requests, you will be able to push a batch of transactions, but each one will be independent.
So, reverting a batch of transactions feels like a non sense for me.
Do you have seen you can create transactions with multiple postings? Using this instead of multiple transactions could allow you to revert all at once juste by reverting the single transaction you created at first.

from ledger.

NathanFirmo avatar NathanFirmo commented on September 16, 2024

Any update??

from ledger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.