On Tue, 22 Jan 2008 20:09:55 -0500 "John Siracusa" <[EMAIL PROTECTED]> wrote: 

JS> On Jan 22, 2008 11:42 AM, Ted Zlatanov <[EMAIL PROTECTED]> wrote:
>> I'd like to try without autocommit; I tried the built-in RDBO
>> transactions but those didn't work well for me.  begin_work was fine,
>> but if an error happened anywhere in the transaction, rollback() didn't
>> do anything and the DB rejected any further transactions.  I could post
>> my code (I tried about 6 different ways), but I'd really like to know if
>> there is an example in the docs anywhere of using transactions.

JS> You can find some examples in the Rose::DB test suite:

JS> http://search.cpan.org/src/JSIRACUSA/Rose-DB-0.737/t/trx.t

JS> If you post one of your 6 ways and explain where it goes wrong, it'd
JS> make it easier to figure out where the problem is.

I found one of the problems is that you forcibly set RaiseError to 1 in
a lot of places, in Rose::DB and Rose::DB::Object.  Why override the
connect_options?

My code is working with do_transaction for now, but begin_work/commit
should really be shown with an eval in the Rose::DB SYNOPSIS.  I got the
impression they would not die from the Rose::DB docs, so their
exceptions were killing an outer eval, and rollback() was not called...
I'd show you the code but it's not interesting or pretty.

I ran with DBI_TRACE set high and checked that the DBD commit was only
called as many times as I specified.  So I'm using transactions to
insert the rows, and RDBO is just not able to handle the load for my
particular task.  With COPY FROM, I can insert about 10-20 times faster
than RDBO, so I'll have to stick with that.  I'll mimic the RDBO SQL
statements and just run them I guess...

Ted

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to