[Dbix-class] Constraints within cursor

Daisuke Murase typester at cpan.org
Tue Oct 3 21:48:19 CEST 2006


You can't call update in ->next loop with SQLite.
This is DBD::SQLite problem, and use $rs->search->all instead of iterator.

Please see below thread for detail.
http://lists.rawmode.org/pipermail/dbix-class/2006-January/thread.html#531

-- 
Daisuke Murase <typester at cpan.org>


On Tue, 3 Oct 2006 19:05:35 +0100, "Peter Edwards" <peter at dragonstaff.com> wrote:
> I hit a problem recently using DBIx::Class against SQLite.
> 
> I was traversing a set of records using a cursor (or rather ->search then
> ->next which I guess is the same thing) and then doing some updates on
> related records in another table.
> 
> Now I know of old from Oracle that a delete within cursor is the sort of
> thing to cause problems, and in this case I was getting an error saying the
> SQLite db was locked. The workaround I used was to select the outer records
> into a perl array then do the updates, which didn't matter in this case as
> the db is only accessed by a single process, but with multiple processes I'd
> run the risk of inconsistent data.
> 
> Is this something I should be solving with locking statements or some other
> means?
> 
>  
> 
> Thanks, Peter
> 
>  
> 



More information about the Dbix-class mailing list