[Dbix-class] Scalar ref update()'s

Jose Fonseca zefonseca at gmail.com
Fri May 16 02:09:53 BST 2008


> I don't think I'd like to see an automatic reload on update.  In my own
> code, the update is the last operation I perform on the object and I
> wouldn't want to see it generate another round trip to the DB.

True indeed. Especially because of the point you made next: the update
doesn't necessarily mean you'll read it immediately.

> Perhaps it would be useful to automatically reload on the next access to
> an object with scalarref values.

This is a good suggestion. Reading back from scalar ref'd update would need
a round trip anyway, I don't see an alternative(using ANSI SQL at least).
This solution would delay the round trip up until no longer avoidable. Sort
of an inverted COW (copy-on-write) for fields marked "dirty" after a scalar
ref'd update.

JF

On Thu, May 15, 2008 at 5:04 PM, Marc Mims <marc at questright.com> wrote:

> * Jose Fonseca <zefonseca at gmail.com> [080515 12:30]:
> > I raised the issue here as a sort of RFC on whether DBIC should
> > reload-on-write from the RDBMS automatically when updated with a scalar
> > ref(literal SQL command).  It seems reasonable that it should, I don't
> think
> > the returned SQL snippet is useful under any circumstance.
>
> I don't think I'd like to see an automatic reload on update.  In my own
> code, the update is the last operation I perform on the object and I
> wouldn't want to see it generate another round trip to the DB.
>
> Perhaps it would be useful to automatically reload on the next access to
> an object with scalarref values.
>
>        -Marc
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.rawmode.org
>



-- =

http://zefonseca.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080515/1e7=
03655/attachment.htm


More information about the DBIx-Class mailing list