sqlca.sqlerrd1 not returning a correct value in in
Posted in 2014
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL, Java & JDBC Development
I have encountered a problem that seems to be related to an upgrade of my Informix server from ver. 11.7FC7 to ver. 11.7FC8. All of a sudden the applications accessing the server get a hibernate error "The database returned no natively generated identity value". The applications are in JAVA and use hibernate 3.2.6.ga and JPA for communication with the database. It seems that the "sqlca.sqlerrd1" is returning 0 when there is an insert in a table as if the serial value has been obsolete. Is there anyone that have encountered this error after upgrading Informix to 11.7FC8? I have tried searching this issue and all I could find was old problems with 4GL programs when doing something between the insert and the retrieval of the new serial value which corresponds with the error we have encountered with hibernate and 11.7FC8. I'm still waiting for the trace information from our developers for the query that fails, one issue there is that the problem isn't consistent, it occurs from time to time.
On 26/02/14 11:39, RICKARD ESPING wrote: > I have encountered a problem that seems to be related to an upgrade of my > Informix server from ver. 11.7FC7 to ver. 11.7FC8. > > All of a sudden the applications accessing the server get a hibernate error > "The database returned no natively generated identity value". > The applications are in JAVA and use hibernate 3.2.6.ga and JPA for > communication with the database. > It seems that the "sqlca.sqlerrd1" is returning 0 when there is an insert in a > table as if the serial value has been obsolete. > > Is there anyone that have encountered this error after upgrading Informix to > 11.7FC8? > I have tried searching this issue and all I could find was old problems with > 4GL programs when doing something between the insert and the retrieval of the > new serial value which corresponds with the error we have encountered with > hibernate and 11.7FC8. > > I'm still waiting for the trace information from our developers for the query > that fails, one issue there is that the problem isn't consistent, it occurs > from time to time. > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > I fixed IC98247 post xC8, which should fix your issue. BTW identity values are not determined by checking sqlca.sqlerrd1 - they have their own message exchange between the client and the engine. -- Ciao, Marco ______________________________________________________________________________ Marco Greco /UK /IBM Standard disclaimers apply! Structured Query Scripting Language http://www.4glworks.com/sqsl.htm 4glworks http://www.4glworks.com Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Thanks Marc Unfortunately, I can not read the document related to IC98247 then my IBM account has insufficient rights. I'll have to wait for my colleague to get back. Could you explain a bit more how the messages between client and server works. Have been looking for information about SQ_SGKTUPLE and SQ_INSERTDONE mentioned in the case without finding anything useful.
On 26/02/14 13:33, RICKARD ESPING wrote: > Thanks Marc > > Unfortunately, I can not read the document related to IC98247 then my IBM > account has insufficient rights. > I'll have to wait for my colleague to get back. > > Could you explain a bit more how the messages between client and server works. > Have been looking for information about SQ_SGKTUPLE and SQ_INSERTDONE > mentioned in the case without finding anything useful. > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > When the java client wants an identity value returned, it will send a special 'prepare' message to the engine that, unlike the normal 'prepare' message, specifies that an identity value is needed. Once the engine receives the 'execute' message it will execute the statement, then send an identity message (the SQ_SGKTUPLE that you are mentioning), which specifies the identity value, and then sends a 'result' message (in the case of an insert, it's the SQ_INSERTDONE message). When the defect occurs, the engine does not send the SQ_SGKTUPLE message, and therefore the client doesn't get the identity value. -- Ciao, Marco ______________________________________________________________________________ Marco Greco /UK /IBM Standard disclaimers apply! Structured Query Scripting Language http://www.4glworks.com/sqsl.htm 4glworks http://www.4glworks.com Informix on Linux http://www.4glworks.com/ifmxlinux.htm