Discussions

We are using WebSphere 3.54 with DB2 Universal version 7. We have a DataSource on WebSphere that has been in production for a very long time. Lately it has started throwing errors that make no sense. In one particular table two records can be successfully inserted but the app throws a "function sequence error" on the third attempted insert. Always the third attempt.

Also, we will get an occassional " a host variable in the EXECUTE or OPEN statement is too large for its corresponding use" exception. Again this makes no sense because it is the same piece of code that makes sucessful inserts.

Has anyone else experienced this?

Does anyone know if the combination of WS 3.54/DB2 v7 has trouble with PreparedStatements?

DB2 is more strict when it comes to cursors/preparedStatements (and so is Sybase BTW)
The "function sequence error " is solely because it looks like you are executing new SQLs without closing the resultset (or Preperedstatement) .
We faced this problem when we executed multiple SQLs (all different ) and did not close the cursor (resultset or PS). Make sure you close the resultset before executing the new SQL . IT should not cause problem if you are executing the same SQL though .

Thanks Mohan. We always close our connections and are very careful about tidying up after a data access call. We've come to the conclusion that our version of WebSphere does not handle PreparedStatements very well. So we are no longer using them. I have a feeling that if we upgraded to WS 5.0 the problem would end.

TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations technology projects - with its network of technology-specific websites, events and online magazines.