digglife / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

Statement prepare Failed #96

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
No defined scenario to reproduce but same query fails the first time and is 
successful the second time is executed. It's hard to analyzed because queries 
are valid.
Additionally, could it be possible to add more detail to the error message?
See below a partial traceback and odbc traces.
My env:
ibm_db-1.0.5-py2.7-linux-x86_64.egg
DB2 9.7 fp4 enterprise

Found this that seems to be related because the ibm_db version I'm using is 64 
bits:
http://www-01.ibm.com/support/docview.wss?uid=swg21454064

  File "/usr/local/lib64/python2.7/site-packages/ibm_db-1.0.5-py2.7-linux-x86_64.egg/ibm_db_dbi.py", line 1279, in execute
    self._prepare_helper(operation)
  File "/usr/local/lib64/python2.7/site-packages/ibm_db-1.0.5-py2.7-linux-x86_64.egg/ibm_db_dbi.py", line 1164, in _prepare_helper
    raise _get_exception(inst)
DatabaseError: ibm_db_dbi::DatabaseError: Statement prepare Failed: 

[02/06/2012 12:16:25.266867] SQLFreeHandle( )
[02/06/2012 12:16:25.266919]     <--- SQL_SUCCESS   Time elapsed - 
+1.738000E-003 seconds

[02/06/2012 12:16:25.267330] SQLAllocHandle( )
[02/06/2012 12:16:25.267397]     <--- SQL_INVALID_HANDLE   Time elapsed - 
+6.700000E-005 seconds

Original issue reported on code.google.com by south.mi...@gmail.com on 6 Feb 2012 at 9:31

GoogleCodeExporter commented 8 years ago
Hi Luis,

Could you provide the complete CLI (ODBC) trace.

While building and installing the ibm_db driver we link against -ldb2 and might 
be the -DODBC64 flag is being picked up during installation in your case. Do 
you have -DODBC64 set in any environment variables (CFLAGS?) which is being 
picked up while installing the ibm_db egg. Or might be you have the odbc option 
turned on sometime during installation of Python or Python module.

Do you see this behaviour against a particular SQL or against all SQLs?

Thanks

Praveen

Original comment by praveen...@in.ibm.com on 7 Feb 2012 at 4:58

GoogleCodeExporter commented 8 years ago
Hi Praveen,

Could you provide the complete CLI (ODBC) trace.

No sure, log contains table details and it's hard to manually anonymize.
Will check and let u know. See attachment with a fragment containing from
query execution until invalid handle error.

I compiled the ibm_db module using the procedure described in issue 91 and
as far as I recall I did not set any extra option or env value.

Other queries failing are simple as the one present in the attached log.
Added a fragment containing the following message

( Unretrieved error message="[IBM][CLI Driver] CLI0002W  Data truncated.
SQLSTATE=01004" )

Best
Luis

Original comment by south.mi...@gmail.com on 7 Feb 2012 at 9:03

GoogleCodeExporter commented 8 years ago
Hi Luis,

You could write a sample app and check if this error occurs with the sample 
too. I wanted to check if this issue is seen only for the use case you are 
running or is it common.

If you are able to repro the issue on a sample app too, then might be you can 
share the trace, possibly we could get some info from it.

Thanks
Praveen

Original comment by praveen...@in.ibm.com on 8 Feb 2012 at 8:06

GoogleCodeExporter commented 8 years ago
Hi Praveen,

I'll try to run a test app on the issue but meantime I found the attached
log that seems to belong to some db2 internal app and the error is present
in it.
Hope it helps, if not just let me know. BTW: could scripts inside
/usr/local/lib64/python2.7/site-packages/ibm_db-1.0.5-py2.7-linux-x86_64.egg/tes
ts/
help to reproduce the issue?

This fragment is from db2diag.log around the SQL_INVALID_HANDLE event.

2012-02-07-12.22.34.384265-480 I521212E511         LEVEL: Event
PID     : 14366                TID  : 140737110861568PROC : db2sysc 0
INSTANCE: db2inst1             NODE : 000          DB   : TESTDB
APPHDL  : 0-36                 APPID: 127.0.0.1.33725.120207202234
AUTHID  : user1
EDUID   : 17                   EDUNAME: db2agent (CMPRSDB) 0
FUNCTION: DB2 UDB, config/install, sqlfLogUpdateCfgParam, probe:20
CHANGE  : CFG DB TESTDB : "Database_memory" From: "66220" <automatic>  To:
"63344" <automatic>

Best
Luis

Original comment by south.mi...@gmail.com on 8 Feb 2012 at 8:40

GoogleCodeExporter commented 8 years ago
Hi Luis,

Given that you are on enterprise edition, can you raise a support request with 
IBM Support. The support people will be able to solve these type of issues 
quicker, as they would have faced similar issues previously.

Keep us posted on the solution you get.

Thanks

Praveen

Original comment by praveen...@in.ibm.com on 9 Feb 2012 at 2:22

GoogleCodeExporter commented 8 years ago
hi Praveen,
But will they give support to python module too? Will contact IBM anyway.

Original comment by south.mi...@gmail.com on 9 Feb 2012 at 3:32

GoogleCodeExporter commented 8 years ago
Hi Luis,

Yes they will support ibm_db python module too.

This looks like more a CLI related issue. As they would have probably handled 
issues like this earlier they could resolve it for you faster.

Thanks

Praveen

Original comment by praveen...@in.ibm.com on 9 Feb 2012 at 3:57

GoogleCodeExporter commented 8 years ago
Hi All,
You can mark this issue as INVALID, the error was on my code. Sorry for the 
inconvenience.

Original comment by south.mi...@gmail.com on 8 May 2012 at 6:03

GoogleCodeExporter commented 8 years ago

Original comment by rahul.pr...@in.ibm.com on 9 May 2012 at 2:57