[Dbix-class] Insert or Update (was ANNOUNCE: 0.08099_08)

Matt S Trout dbix-class at trout.me.uk
Sun Apr 19 10:14:59 GMT 2009


On Sat, Apr 18, 2009 at 03:29:24PM -0700, John Napiorkowski wrote:
> 
> 
> 
> --- On Sat, 4/18/09, Jess Robinson <castaway at desert-island.me.uk> wrote:
> 
> > From: Jess Robinson <castaway at desert-island.me.uk>
> > Subject: Re: [Dbix-class] Insert or Update (was ANNOUNCE: 0.08099_08)
> > To: "DBIx::Class user and developer list" <dbix-class at lists.scsys.co.uk>
> > Date: Saturday, April 18, 2009, 6:38 AM
> > 
> > On Sat, 18 Apr 2009, Jess Robinson wrote:
> > 
> > >
> > > On Fri, 17 Apr 2009, Peter Corlett wrote:
> > >
> > >>  On Mon, Apr 13, 2009 at 02:46:54PM +0100,
> > Peter Corlett wrote:
> > >>  [...]
> > >> >  diff --git
> > a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm
> > >> >  index 816b374..a8d501b 100644
> > >> >  --- a/lib/DBIx/Class/ResultSet.pm
> > >> >  +++ b/lib/DBIx/Class/ResultSet.pm
> > >> >  @@ -2103,13 +2103,43 @@ sub
> > update_or_create {
> > >> 
> > >> >  From the lack of response to my patch,
> > I can only conclude that people
> > >>  *want* DBIC to be full of race conditions
> > and potential data corruption.
> > >> 
> > >
> > 
> > And now I've read the lower bits of the thread. Nope, don't
> > like the 
> > patch. See answers below (prefer components or storage
> > layer 
> > implementations).
> > 
> > Jess
> 
> I also have some concerns related to any of the bits where reads and writes are mixed (or potentially so) behind the scenes, since the replication code has to allow the read source to potentially lag from the write source.  For me, I'd like to see more of this deferred to the storage layer, since the replicated storage can then intercept it and do the right thing, to keep stuff consistent.

And we have to handle the fact that not all storages support transactions.

And not everything that does supports savepoints.

And the patch didn't come with tests, so I assumed he didn't *want* it to
be applied ...

Valid idea though, and something we should look at making a capability in
storage for 09 - in the meantime I'd recommend rewriting it as a reusltset
component just as people already suggested, repeatedly.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list