Please keep this on the list; I have added dbi-users to my response.

--
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.htm
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 06, 2002 14:41
Subject: RE: Re: Oracle DBI commit/rollback question...


> Thanks Mac, but what I'm doing is looping different DML statements
> through several calls to do() in the same database connection.

You can prepare many statement handles with the same database handle.  Then
all you need is execute() at the appropriate points, not do() which includes
prepare() as well.  With placeholders, which I strongly recommend, a
statement handle can be executed many times.

> I'm calling commit() or rollback() (depending on results from eval)
> after all DML statements have been passed, but before I disconnect.
>
> I'm wondering if only the last DML statement before error (or program
> completion) gets committed or rolled back, or if all statements do.

A transaction is a unit of work, all DML in the transaction gets committed
or rolledback together.

> -----Original Message-----
> From: mchase
> Sent: Wednesday, February 06, 2002 5:26 PM
> To: Wren, David; dbi-users
> Cc: mchase
> Subject: Re: Oracle DBI commit/rollback question...
>
> Until your execute() or do() the statement hasn't occurred yet, so
> there's
> nothing to commit or rollback.
>
> Each time you commit or rollback, a new transaction starts.
>
> Transactions are session specific, so the transactions in two open
> database
> handles in the same program are independent of each other.
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 06, 2002 14:03
> Subject: Oracle DBI commit/rollback question...
>
>
> > Does anybody know how Oracle8i handles transactions from DML
> statements
> > passed from a DBI database connection?
> >
> > Do the dbh->commit() and dbh->rollback() statements commit or rollback
> > all DML instructions issued while the connection is open, or just
> those
> > which get passed by sth->do() or sth->execute()?



Reply via email to