mysql insert fails due to identity = 0

3 posts, 0 answers
  1. Anthony
    Anthony avatar
    13 posts
    Member since:
    Aug 2014

    Posted 26 Aug 2014 Link to this post

    I have two identical databases in MSSQL and MySQL to test my app. It works perfectly in MSSQL, but it fails after trying to insert in MySQL. The debugger shows it failing right after  


    The debugger also shows this after the Add operation:

    OpenAccessEnhancedFlags -1
    OpenAccessEnhancedStateManager PCStateMan GeotechReport NEW

    The MSSQL run shows the same information, so maybe it isn't significant, but I thought I'd at least mention it. The MySQL database column called RowID is set to be primary key, auto increment, unsigned, not null. The rlinq property called identity mechanism is assigned to DatabaseServerCalculated as the documentation suggests.

    What am I missing?
  2. Anthony
    Anthony avatar
    13 posts
    Member since:
    Aug 2014

    Posted 27 Aug 2014 in reply to Anthony Link to this post

    Well, I can't explain why, but now it works. I deleted the domain model project and started over completely. I did everything the same, but maybe in a different order. I had previously used a domain model that linked to SQL Server 2014 in the project, which I deleted before I added a domain model that linked to MySQL.

    I also recreated the underlying table, so maybe I had a setting wrong in one of the two places (the domain model or the table). It works now, though.
  3. DevCraft banner
  4. Ralph Waldenmaier
    Ralph Waldenmaier avatar
    202 posts

    Posted 28 Aug 2014 Link to this post

    Hello Anthony,
    First I am glad that now your project is working as expected. Nevertheless we would be interested in what was causing the issue. So in case you experience this behavior again, please contact us again.

    Feel free to ask in case you have any other question.

    Ralph Waldenmaier
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top