You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by ca...@mynet.com on 2010/01/26 12:40:08 UTC

Re : sql server pk generation ??

hi all...

i use cayenne 3.0RC1 , msde, jdbc driver is jtds-1.2.5...

I mapped db tables and  set the primary key generation from database by
modeller.(database generated)

all selects returned successfull... but when i insert a row there is a
problem...

exceptions :

if custom adapter  is blank or JdbcAdapter or SysbaseAdapter 
then 

Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
[v.3.0RC1 Dec 27 2009 11:45:54] Commit Exception
    at
org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1134)
    at
org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045)
    at Main.main(Main.java:78)
Caused by: java.sql.SQLException: Cannot insert explicit value for
identity column in table 'CARIGEN' when IDENTITY_INSERT is set to OFF.
    at
net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
    at
net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2820)

...................

when custom adapter is SqlServerAdapter exception is 

 org.apache.cayenne.CayenneRuntimeException: [v.3.0RC1 Dec 27 2009
11:45:54] One and only one PK row is expected, instead got 0


i tried cayenne-1.2 but same result...

any suggestion ?
  



_______________________________________________
	
	
		Nilüfer 'Zalimin Kararı' şarkısı ile ilk defa ve sadece kavun'da! Tıkla,
Dinle!