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

Peter Rabbitson rabbit+dbic at rabbit.us
Mon Feb 3 22:16:23 GMT 2014


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 ;)



More information about the DBIx-Class mailing list