Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Philippe Vanden Broeck
RE: ruby terminates badly [ reply ]  
2007-08-31 18:11
Hi Alex,
I have no XP box at hand, so I'll stick to 0.7.5, which is not an issue as I don't need the informix support. Good luck !

By: Alex Pitigoi
RE: ruby terminates badly [ reply ]  
2007-08-30 18:14
Philippe, as you may have already noticed, there seems to be no issue with the ibm_db driver in the IBM_DB-0.8.0 gem except on Windows Vista platform (regarding the SegFault reported). Therefore, you should be able to use a Windows XP client successfully with the latest gem refresh. Our driver team is currently investigating the specifics of building with MS VS7 and running in the Vista environment. There are a few known incompatibilities and we hope to determine is this is such a case and find a work-around.

By: Philippe Vanden Broeck
RE: ruby terminates badly [ reply ]  
2007-08-29 11:15
Quite fast !

Thank you

By: Alex Pitigoi
RE: ruby terminates badly [ reply ]  
2007-08-28 18:42
We now have a repro of your defect on "DB2 v9.1.200.98", "s070210", "WR21380", and Fix Pack "2". We'll keep you posted on our progress and we hope you can continue for a while using IBM_DB-0.7.5 (no Informix support). The initial assessment of this issue seems to point to the new MS compiler (VS7) used to build the ibm_db driver (previously built with VS6, now with VS7).

By: Philippe Vanden Broeck
RE: ruby terminates badly [ reply ]  
2007-08-28 18:02
No actually. But it is the free version I downloaded from IBM's site. Provided that I have a free version that is compatible with ibm_db and Ruby, I have no other special requirements.
But, as I said, it is working OK with the 0.7.5 driver.

By: Alex Pitigoi
RE: ruby terminates badly [ reply ]  
2007-08-28 17:15
Philippe, I was wondering, do you have a hard requirement in using a special build for DB2 9.1 FP2 ?

By: Philippe Vanden Broeck
RE: ruby terminates badly [ reply ]  
2007-08-28 17:09
Hi Alex,

Yes, both computers share the very same environment : Win Vista Pro and DB2 9.1.2 build (DB2 v9.1.200.166, special_17369), ruby 1.8.6, rubygems 0.9.4,rails 1.2.3.

By: Alex Pitigoi
RE: ruby terminates badly [ reply ]  
2007-08-28 14:48
We are in the process of recreating the problem and it would be helpful to know if both machines which exhibited the issue are running Win Vista Pro and the special DB2 9.1.2 build (DB2 v9.1.200.166, special_17369).

By: Philippe Vanden Broeck
RE: ruby terminates badly [ reply ]  
2007-08-25 11:37
I know I shouldn't reply to myself but... As I told you, I encounter this issue on two different computers running in the same environment.
As I had 2 ibm_db installedon both machines (0.7.5 and 0.8.0), I ran a gem unistall ibm_db to remove 0.7.5 from one computer and 0.8.0 from the other.
Now the computer running 0.7.5 runs OK with Ruby on rails : I can connect to db2 and do some scaffolding.
The computer running 0.8.0 still terminates Ruby as described before.
HIH

By: Philippe Vanden Broeck
RE: ruby terminates badly [ reply ]  
2007-08-24 21:34
It seems I have 2 different drivers installed :

gem list gives this :

ibm_db <0.8.0,0.7.5>

and I also have 2 ibm_db.so files :

C:\ruby\lib\ruby\gems\1.8\gems\ibm_db-0.7.5-mswin32\lib\mswin32
C:\ruby\lib\ruby\gems\1.8\gems\ibm_db-0.8.0-mswin32\lib\mswin32

I have only one db2 installed. Code release is SQL09012 with level identifier 01030107.
DB2 v9.1.200.166, special_17369, WR21380_17369 and Fix Pack 2.

I'll post the trace files tomorrow.

Thanks

By: Alex Pitigoi
RE: ruby terminates badly [ reply ]  
2007-08-24 19:14
Ok, it seems the driver has a problem. Now, we need to assess first if this is the expected (IBM_DB-0.8.0 gem) driver, and if there's anything special about the environment (maybe running multiple DB2 client version on the same machine ?). Can you please verify IBM_DB gems installed (> gem list) and also if by any chance you have multiple ibm_db.so in different places.

Can you please describe your DB2 environment in a bit more detail (db2level, how it was installed, if fixpacks were added over, etc.) and also post the CLI trace in a defect here: http://rubyforge.org/tracker/?group_id=2361

Thanks,
Alex

By: Philippe Vanden Broeck
RE: ruby terminates badly [ reply ]  
2007-08-24 18:42
Heloo Alex,

Thanks for the quick reply.

I tried your suggestions. All things went well until :

irb(main):003:0> stmt = IBM_DB::exec conn, 'select schemaname from syscat.schemata'

After running this statement, Ruby terminated like this:

<irb>:3: [BUG] Segmentation fault
ruby 1.8.6 <2007-03-13> [i386-mswin32]
This application has requested the Runtime to terminate it in an unusual way. (etc.)

I traced as you asked. Reading the log, it seems all was successful :

[24/08/2007 20:32:00.302212] SQLExecDirect( hStmt=1:1 )
[24/08/2007 20:32:00.312645] ---> Time elapsed - +1,008100E-002 seconds
[24/08/2007 20:32:00.313424] ( pszSqlStr="select schemaname from syscat.schemata", cbSqlStr=38 )
[24/08/2007 20:32:00.337615]
[24/08/2007 20:32:00.338459] ( StmtOut="select schemaname from syscat.schemata" )
[24/08/2007 20:32:00.350505]
[24/08/2007 20:32:00.360434] ( Package="SYSSH200 ", Section=4 )
[24/08/2007 20:32:00.532880]
sqlccsend( Handle - 79762080 )
sqlccsend( ulBytes - 328 )
sqlccsend( ) rc - 0, time elasped - +1,710000E-004
sqlccrecv( timeout - +0,000000E+000 )
sqlccrecv( ulBytes - 164 ) - rc - 0, time elapsed - +1,305100E-002
sqlccsend( Handle - 79762080 )
sqlccsend( ulBytes - 122 )
sqlccsend( ) rc - 0, time elasped - +1,100000E-005
sqlccrecv( timeout - +0,000000E+000 )
sqlccrecv( ulBytes - 309 ) - rc - 0, time elapsed - +8,090000E-004
[24/08/2007 20:32:00.617635] ( Requested Cursor Attributes=134217731 )
[24/08/2007 20:32:00.631541]
[24/08/2007 20:32:00.632247] ( Reply Cursor Attributes=524298 )
[24/08/2007 20:32:00.651735]
[24/08/2007 20:32:00.662016] ( Actual Cursor Attributes=524299 )
[24/08/2007 20:32:00.673040]

[24/08/2007 20:32:00.674038] SQLExecDirect( )
[24/08/2007 20:32:00.684235] <--- SQL_SUCCESS Time elapsed - +3,820230E-001 seconds

How do I "open a defect" ?

Thanks

By: Alex Pitigoi
RE: ruby terminates badly [ reply ]  
2007-08-24 17:35
Hi Philippe,

We need to better understand your environment in order to get to the root cause and maybe recreate the problem.

First, it would be quite helpful to know if you are able to establish a database connection (local or remote) through the driver directly and execute a SQL statement.

Example:
> db2 CREATE DATABASE railsdb AUTOMATIC STORAGE YES USING CODESET UTF-8 TERRITORY US COLLATE USING SYSTEM PAGESIZE 32768


> irb
irb(main):001:0> require 'mswin32/ibm_db'
=> true
irb(main):002:0> conn = IBM_DB::connect 'railsdb', 'db2admin', 'password'
=> #<IBM_DB::Connection:0x4000075e1e0>
irb(main):003:0> stmt = IBM_DB::exec conn, 'select schemaname from syscat.schemata'
=> #<IBM_DB::Statement:0x40000756d50>
irb(main):004:0> IBM_DB::fetch_assoc stmt
=> {"SCHEMANAME"=>"ATEST "}


If this works, then you may want to also sanity test quickly the adapter:
Example:
# Create Rails app, model, migration
> rails railsapp
> cd railsapp
# edit config\database.yml as below
"development:
adapter: ibm_db
database: railsdb
username: db2admin
password: password
schema: railsapp"
> ruby script/generate model person name:string age:integer phone:string
> rake db:migrate

> ruby script\console
Loading development environment.
>> p = Person.new
=> #<Person:0x400021284b8 @attributes={"name"=>nil, "phone"=>nil, "age"=>nil}, @new_record=true>
>> p.name = "First"
=> "First"
>> p.save
=> true
>> Person.find :all
=> [#<Person:0x40002109a18 @attributes={"name"=>"First", "id"=>140, "phone"=>nil, "age"=>nil}>]

If any of the test above fail to succeed you may want to take a DB2 trace while the failing statement is executed:
Example:
http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.pd.doc/doc/c0020795.htm
> db2 UPDATE CLI CFG FOR SECTION COMMON USING Trace 1
> db2 UPDATE CLI CFG FOR SECTION COMMON USING TracePathName <path>
> db2 UPDATE CLI CFG FOR SECTION COMMON USING TraceComm 1
> db2 UPDATE CLI CFG FOR SECTION COMMON USING TraceFlush 1
> db2 UPDATE CLI CFG FOR SECTION COMMON USING TraceTimeStamp 3
> db2 GET CLI CFG FOR SECTION COMMON

Please let us know how the sanity test went or open a defect with your trace captured during connection of statement execution.

Thanks,
Alex


P.S. Here's also a few hints in case you see one of the following error codes:
> db2 connect to railsdb user db2admin using password
> db2 update db cfg using APPLHEAPSZ 1024 // avoids "SQL0954C Not enough storage is available"
> db2 UPDATE CLI CFG FOR SECTION COMMON USING PATCH2 58 // avoids "CLI0114E Datetime field overflow"

By: Philippe Vanden Broeck
ruby terminates badly [ reply ]  
2007-08-24 16:55
Hello,

When I try to connect to db2, Ruby terminates badly with the message: 'This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.'

I am on Windows Vista Professional, DB2 v9 FP2, ibm_db 0.8.0. Also using Aptana ide.

Just doing the following : in Aptana, I create a new Rails project. Edit the database.yml with :

adapter: ibm_db
database: iab_loca
username: vdbrophi
password: myPass
schema: iab

Then I simply start webrick, launch the built-in browser and click on the 'About your application's environment' link.

Then Ruby dies with the message above.

The debugger points to the following line in ibm_db_adapter.rb :

if stmt = IBM_DB::exec(@adapter.connection, sql)

The database is local and running.

This happens on two different computers with the same settings.

TIA