Forums Register Login

Problem persisting id field with an autoincrement field

+Pie Number of slices to send: Send
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!
+Pie Number of slices to send: Send
How do you map that id? There are probably many different generation types that Toplink defines, and maybe you aren't using the correct one.

like in Hibernate there is "native", "auto-increment" and "identity"

Mark
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2289 times.
Similar Threads
Problem with OJB
How to update table with autoincrement column in JSF application
TOPLINK-41 for SQL Server 2005 and Identity Column
Hibernate @GeneratedValue problem
Problems using GenerationType.IDENTITY for in-memory databases
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:57:37.