Sandeep Shekhawat

Sandeep Shekhawat

  • 919
  • 859
  • 906.9k

Rollback and Commit command in Transaction?

Jun 1 2011 5:30 AM
I have a field in table that is auto increment. There increment and seed is (1,1) .So My first row enter in database table then this field value is 1. After that i am inserting second row but from the catch block my transaction is rollback(i am using commit in try block after insert statement.). so my second row did not insert. now i am insert again a row that time it inserted and my auto increment field value is 3 and total rows are 2. that is my problem "If row does not insert in to database table then why increment auto increment field of database table ".

If i am say something wrong pls ignore it.

Answers (6)