Problem persisting id field with an autoincrement field
Timothy Sam
Ranch Hand
Joined: Sep 18, 2005
Posts: 745
posted
0
Hi guys! I'm trying the CRUD functionality with netbeans 5.5. Thing used to be ok until I tried creating an identity columnn in SQLSever 2005. It says...
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Cannot insert explicit value for identity column in table 'user_types' when IDENTITY_INSERT is set to OFF.Error Code: 544 Call:INSERT INTO user_types (user_type_id, description) VALUES (?, ?) bind => [null, Administrator] Query:InsertObjectQuery(com.worldpartner.wpinventory.UserTypes[userTypeId=null]) Exception Description: No transaction is currently active
It seems like SQLServer doesn't like taking the input NULL or anything in the autoincrement column. But ofcourse my userType bean would always persist that id field. What could be wrong? Thanks!