Hi below is the code which I have with me.
use strict; use warnings; use RDBO::QUEUE; my $db = RDBO::RDBO->init_db; my $going = 1; while($going) { my $queued_ids = Rose::DB::Object::Manager->get_objects_from_s +ql( object_class => 'RDBO::QUEUE', sql => 'SELECT id FROM queue WHERE flag=\'F\ ORDER BY +id ASC where ROWNUM< 50', db => $db ); my @ids2process; foreach my $num (@{$queued_ids}) { push(@ids2process, $num->{'id'}); } if(!scalar(@ids2process)) { sleep(5); } if(scalar(@ids2process) > 0 ) { $db->begin_work; my $count=0; foreach my $ids (@ids2process){ $count++; my $ret = HandleIds($id); next if($ret == -1); eval{ my $q_rec = RDBO::QUEUE->new(id => $id, db => $db); $q_rec->load; $q_rec->flag('T'); $q_rec->save; }; if($@) { print "Unable to update record for $id";} else { print "Updated record for $id";} if(($count % 25 == 0) || ($count == scalar(@ids2process))) { $db->commit; print "COMMIT at $count IDs"; } } }else { sleep(5); } }

In reply to Re: db commit is not happening properly with Rose::DB by shree
in thread db commit is not happening properly with Rose::DB by shree

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.