[Dbix-class] Microsoft SQL Server Primary Key Auto-Increment Woes

Marc Mims marc at questright.com
Tue Aug 12 18:47:50 BST 2008


* John Myles White <jmw at johnmyleswhite.com> [080710 07:40]:
> I've recently been tasked at work with porting a large in-house web app 
> that uses DBIx::Class from MySQL to Microsoft SQL Server. In the  
> process, I've come across a problem where the auto-incrementing primary 
> key column of the first row created using a DBIx::Class schema object is 
> given an undef value rather than its true numeric value. All subsequent 
> calls to create() against the same schema object give the proper numeric 
> value of the primary key. Also, this problem does not come up if any 
> other method such as find() or search() has been previously called 
> against the schema object. Only a create() that is the very first method 
> called on a given schema fails.
> [snip]

I committed a fix for this.
http://dev.catalyst.perl.org/svnweb/bast/revision?rev=4750

Please retest with trunk and let me know if you have any problems.

A big thanks to Michael Higgins for getting me access to a MSSQL server
for debugging and testing.

	-Marc



More information about the DBIx-Class mailing list