On Wed, Mar 28, 2001 at 08:08:00PM +0100, Robin Szemeti wrote:
> On Wed, 28 Mar 2001, Paul Makepeace wrote:
> > Can Perl do distributed database transactions? 
> 
> probably .. simple multi threaded app, fork a few child processes,
> establish the odd DBI connection, execute a query each return when the
> last child is reaped ... 100 lines?

I think the key word in Paul's question was "transactions".
In other words, you have more than one database, possibly
in different physical (and network) locations, and you need
to perform a transaction - an _atomic_ transaction - across
several of them.

No partial failure allowed, it has to either succeed completely
or fail completely.

The obvious example is a bank transfer. Add the money to one
account, remove it from the other. Oops, the second part failed.
Double your money!

Actually, any e-commerce operation has the same problem. You
need to fulfil the order *and* charge the customer - those
two things almost certainly can't happen on the same machine.
If you do one and not the other, then either the supplier or
the customer is obviously losing out. It has to be neither or
both.


I think that's what Paul was talking about. He can correct me
if I'm wrong :-)

 .robin.

-- 
select replace(a, CHR(88), replace(a,'''','''''')) from (
select 'select replace(a, CHR(88), replace(a,'''''''','''''''''''')) from (
select ''X'' a from dual)' a from dual)

Reply via email to