Databases: Which one's right for me?

Aaron Watters aaron at reportlab.com
Tue Jan 13 19:33:21 EST 2004


""Tim Peters" <tim.one at comcast.net> wrote in message news:<mailman.304.1073931560.12720.python-list at python.org>...
> [Aaron Watters]> 
> > Transactions don't have to be complex to cause serious problems in
> > read-committed mode:  the classic example is a debit of $1000 for
> > checking account 123 running at the same time as a credit for $4000
> > for checking account 123.  If both transactions run at the same time
> > and read the same previous (committed) balance and they both
> > complete but the first one completes last then the customer is
> > screwed to the tune of $4000.
> 
> This one isn't a problem in ZODB.  The second transaction that tries to
> commit will fail, with a ConflictError exception.  It's up to the
> application then to either abort the failed transaction, or retry it....

Alright, just for yucks.  
Total blood supply must be kept above 50 except during emergencies.
Two transactions notice that there are 40 in bin 1 and 40 in bin two,
so one takes 30 units from bin 1 and the other takes 30 units from bin 2.

Or even return to the original problem assuming that the balance doesn't
change but the debits are entered as separate journal entries, where the
current balance is computed on the fly as the old balance less withdrawals...

Sorry, I just don't know when to shut up, I know.  But when I see
ACID I assume these things are not a problem.
   -- Aaron Watters

ps: Tim anticipated this reply in his post somewhat, but wasn't
  concrete enough for my taste.
===
It ain't the years, it's the mileage.  -- Indiana Jones



More information about the Python-list mailing list