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 <[EMAIL PROTECTED]>


On Tue, 3 Oct 2006 19:05:35 +0100, "Peter Edwards" <[EMAIL PROTECTED]> 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
> 
>  
> 

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to