Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL-Exception on save with sql server dialect #24

Open
sengmann opened this issue Oct 24, 2017 · 0 comments
Open

SQL-Exception on save with sql server dialect #24

sengmann opened this issue Oct 24, 2017 · 0 comments

Comments

@sengmann
Copy link
Member

When we are using sql server dialect and use the save or update method there will be this exception. In #18 you suggest to use Column#setIgnoreOnUpdate(true). But we need to set this on every table we use. Better when LSql sets automatically on primary key columns ignoreOnUpdate=true

Caused by: java.sql.SQLException: Cannot update identity column 'id'.
	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) ~[jtds-1.3.0.jar:1.3.0]
	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2893) ~[jtds-1.3.0.jar:1.3.0]
	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2335) ~[jtds-1.3.0.jar:1.3.0]
	at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:638) ~[jtds-1.3.0.jar:1.3.0]
	at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:613) ~[jtds-1.3.0.jar:1.3.0]
	at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:572) ~[jtds-1.3.0.jar:1.3.0]
	at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:727) ~[jtds-1.3.0.jar:1.3.0]
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[HikariCP-2.5.1.jar:na]
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[HikariCP-2.5.1.jar:na]
	at com.w11k.lsql.Table.executeUpdate(Table.java:487) ~[lsql-core-0.23.0.jar:na]
	at com.w11k.lsql.Table.updateWhere(Table.java:229) ~[lsql-core-0.23.0.jar:na]
	... 44 common frames omitted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant