getKey from SQL Server

I am kind of confused about this because this worked yesterday and I have no clue what changed… On SQL Server 2014, Ignition 7.8 on Java 8.65

I cannot retrieve the key from an insert using getKey:

Here is a simplified example that fails

A) SQL
create table temp (id int identity (1,1)not null, name varchar(110) null)

ALTER TABLE [temp] ADD CONSTRAINT [PK_temp] PRIMARY KEY CLUSTERED
(
[id] ASC
)

B) Button on window
qry = “INSERT INTO TEMP (name) Values (?)”
v = “I was here”
ts = system.db.runPrepUpdate(qry, [v], getKey=1)
print ts

C) result

Traceback (most recent call last):
File “event:actionPerformed”, line 3, in

java.lang.Exception: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO TEMP (name) Values (?), [I was here], , true, false)

caused by Exception: Error executing system.db.runPrepUpdate(INSERT INTO TEMP (name) Values (?), [I was here], , true, false)
caused by GatewayException: SQL error for "INSERT INTO TEMP (name) Values (?)": A result set was generated for update.
caused by SQLServerException: [b]A result set was generated for update. 

[/b]

The INSERT succeeds but the key is not returned and the code errors out

Ideas welcome

Thanks

This solved itself sort of… Java on the server had tried to update and had deleted some files in the 8.0.65 folder.

I allowed it to finish and the problem disappered.

I’m leaving the topic in case it can help others.

Behavior is back… Has anyone else seen this? Have restarted gateway and no Java update this time

From everything I can see it looks like a JDBC driver bug.
Have you tried formatting it as a runUpdateQuery?

I’ve not tried as a runUpdateQuery - I changed it to a stored procedure instead.