Re: [CDBI] Why does CDBI not populate the object on insert

Perrin Harkins <[email protected]> Thu, 5 Mar 2009 18:45:38 -0500
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
On Thu, Mar 5, 2009 at 6:29 PM, Kevin Brown <[email protected]> wrote:
>> Ya, but my point of course is if I just defined the artist name
>> I probably don't need to fetch it back from the database.
>
> That would be true for a single user application, but what about a
> database system with multiple people accessing it at the same time?

That isn't really the problem this was meant to solve.  Any time you
read data from the db and don't grab an exclusive lock (e.g.
SELECT...FOR UPDATE), someone else can change it while you're working
on the data.

This re-fetch is just meant to handle changes made by the database
itself, through triggers or type coercion.

- Perrin