[Dbix-class] Strange statistically significant failure for DBIC with Sybase

Phillip Moore w.phillip.moore at gmail.com
Tue Feb 4 12:07:48 GMT 2014


Thanks for the debugging tips.   I'll see what that teaches me today.

I have no choice but to get to the bottom of this.   We're trying to update
an ancient system that I wrote back in the 1990s (yes, I'm old), which is
tied to Sybase, and ironically one of the reasons we're moving to DBIC
first is to enable getting OFF of Sybase.   The strategy was to implement
the DBIC ORM model, and then migrate to a more modern RDBMs, but if we
can't get DBIC to work reliably with Sybase, then we're screwed.

Sadly, I have no way to get you access to a Sybase database to test on,
unless I buy the damn thing myself.   The free versions of Sybase allow so
few connections that you almost certainly cant' reproduce this problem,
either.    I did some of the testing for you a year ago on the free
version, and then had to abandon it when we got things working, and I
started running my real test suite against it.  It's heavily parallelized
and without allowing at least 32 connections (the free one gives you 5,
IIRC) it just won't run.   We moved development in house at that point
(this was an OSS product no one cares about), and have been working with
the supported Enterprise versions of Sybase ever since.

As for reducing this to a small test case, that's going to be extremely
difficult, since it's a very large system I'm working with.   If Peter's
debugging hints don't give me enough clues to get to the bottom of this on
my own, that's the next step.   I'm going to spend all of today digging
into this, and if I can't get somewhere by week's end, then I'll try to
create something that reproduces it.


On Mon, Feb 3, 2014 at 5:16 PM, Peter Rabbitson <rabbit+dbic at rabbit.us>wrote:

> On Mon, Feb 03, 2014 at 04:34:07PM -0500, Phillip Moore wrote:
> >
> > I'm starting to see a problem where about 2% of the DBIC objects I create
> > come back with a primary key (which is a Sybase identity column) whose
> > value has been incremented one too many times.
> > ...
> > I am working on getting more in depth debugging information, and I am
> well
> > aware that this problem report is lacking in such details, but in the
> > meantime do these symptoms sound familiar to anyone at all?
>
> Yes, the way we talk to Sybase is rather hideous:
>
> https://metacpan.org/pod/DBIx::Class::Storage::DBI::Sybase::ASE#INSERTS-WITH-PLACEHOLDERS
>
> Some debug ideas: look at the result of DBIC_TRACE=1 to see if you are
> indeed affected by this (a SELECT MAX query being fired). If not the
> case - likely something to do with how @@IDENTITY is isolated on your
> version of Sybase (likely badly). You could also DBI_TRACE=2=logfile
> (note DBI not DBIC) to see what values does DBIC see coming from DBI (to
> rule out a DBIC-level problem). Also you could potentially have issues
> with retries, though this is much less likely - set
> DBIC_STORAGE_RETRY_DEBUG=1 to see those.
>
> In either case - please please do get to the bottom of this. It looks
> like a rather serious problem, I don't want to leave it unsolved, but at
> the same time do not have easy access to a Sybase server (wink wink
> nudge nudge ;)
>
> _______________________________________________
> 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.scsys.co.uk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20140204/a33c63c3/attachment.htm>


More information about the DBIx-Class mailing list