Re: [PATCH v2 3/4] odb: prepare `struct odb_transaction` to become generic
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Feb 4, 2026, 10:31 UTC
- Message-ID
- <CAOLa=ZRb1eVSD42Obr_m+3KUy0Bh=0XmOZt8ofrbzy4Mp8xfwQ@mail.gmail.com>
- In-Reply-To
- <20260203001002.2500198-4-jltobler@gmail.com>
Justin Tobler <jltobler@gmail.com> writes:
[snip]
Show 10 quoted lines
> + > +/* > + * A transaction may be started for an object database prior to writing new > + * objects via odb_transaction_begin(). These objects are not committed until > + * odb_transaction_commit() is invoked. Only a single transaction may be pending > + * at a time. > + * > + * Each ODB source is expected to implement its own transaction handling. > + */ > struct odb_transaction;
Nit: Wouldn't it be nicer to just the below `struct odb_transaction` here and drop this line?
Show 13 quoted lines
> +typedef void (*odb_transaction_commit_fn)(struct odb_transaction *transaction);
> +struct odb_transaction {
> + /* The ODB source the transaction is opened against. */
> + struct odb_source *source;
> +
> + /* The ODB source specific callback invoked to commit a transaction. */
> + odb_transaction_commit_fn commit;
> +};
>
> /*
> * The object database encapsulates access to objects in a repository. It
> --
> 2.52.0.373.g68cb7f9e92Just a question in general, is the idea to eventually also add support for {prepare, rollback} within odb transactions?