From: Farrukh Najmi <farrukh@wellfleetsoftware.com>
To: Kyle Moffett <kyle@moffetthome.net>
Cc: git@vger.kernel.org
Subject: Re: Any plans to support JTA and XA in jgit?
Date: Fri, 14 Nov 2008 09:45:51 -0500 [thread overview]
Message-ID: <491D8F1F.7090803@wellfleetsoftware.com> (raw)
In-Reply-To: <f73f7ab80811140638m4045cf83p311c593aff066002@mail.gmail.com>
Kyle Moffett wrote:
> On Thu, Nov 13, 2008 at 3:27 PM, Farrukh Najmi
> <farrukh@wellfleetsoftware.com> wrote:
>
>> The problem I am trying to solve is this. In my service I need to store
>> metadata in a relational db and content in git such that both either commit
>> or not in a single transaction. If one commits and the other does not that
>> is a serious integrity issue. Seems to me, two phase commit would be the
>> right solution for that in the long run. This what JDBC + JMS topologies do.
>>
>
> That's really easy! First tweak jgit so that *instead* of using
> .git/refs, it uses your database to store references and exports them
> on a routine basis to .git/refs for debugging purposes.
Wow! This does sound simple in theory. Of course I have much to learn
about jgit code base first.
Any pointers on what parts of the code are involved that I should start
looking at? I would hate to
keep a fork of gjit around. Would this work be of interest to the
project if it could be done in a way
that a few properties control whether to use database or not?
Thanks Kyle!
> Then, for
> each database update:
>
> (1) Start transaction
> (2) Commit the change to GIT (adds ref update to the transaction)
> (3) Make other metadata updates
> (4) Commit transaction
>
> Then set up periodic garbage collection and you're done! If the
> transaction is aborted, there will simply be a bunch of random loose
> objects in the git repository, which will be cleaned up the next time
> you garbage collect. The ref update will be atomic and conditional
> with the rest of the transaction, and in git the *only* part that
> really matters for atomicity is the ref.
>
> Cheers,
> Kyle Moffett
>
>
--
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com
next prev parent reply other threads:[~2008-11-14 14:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-13 19:59 Any plans to support JTA and XA in jgit? Robin Rosenberg
2008-11-13 20:27 ` Farrukh Najmi
2008-11-13 21:54 ` Robin Rosenberg
2008-11-14 14:38 ` Kyle Moffett
2008-11-14 14:45 ` Farrukh Najmi [this message]
2008-11-15 20:21 ` Any overview available on jgit codebase? Farrukh Najmi
2008-11-15 23:15 ` Shawn O. Pearce
2008-11-16 0:21 ` Farrukh Najmi
-- strict thread matches above, loose matches on Subject: below --
2008-11-13 19:20 Any plans to support JTA and XA in jgit? Farrukh Najmi
[not found] ` <200811132057.32026.robin.rosenberg.lists@dewire.com>
2008-11-13 20:07 ` Robin Rosenberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=491D8F1F.7090803@wellfleetsoftware.com \
--to=farrukh@wellfleetsoftware.com \
--cc=git@vger.kernel.org \
--cc=kyle@moffetthome.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox