[jboss-user] [EJB 3.0] - Getting Exception - Cannot insert explicit value for identit

ruchi123456 do-not-reply at jboss.com
Sun Jun 17 05:13:31 EDT 2007


Good Morning, 
  
I am trying to use EJB 3 with jboss4.0.5. Ran into a (simple I hope problem). Defined a very simple class that displays a few rows from the database. I am using SQL 2000 and my Primary Key is an Identity column. When I try to add a row it attempts to insert a value into the key column as well which of course does not work: 
  
com.inet.tds.SQLException: [DB3]Cannot insert explicit value for identitycolumn in table 'Address' when IDENTITY_INSERT is set to OFF. 
  
I tried annotating the column both as: @Id and also as: 
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
but got the same error. 
  
I am using jboss4.0.5 by the way. 
  
Can someone direct me in the right direction please? 
Regards, 
Ruchika

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055012#4055012

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055012



More information about the jboss-user mailing list