I was trying to import server_info api in the ibm_db extension. It worked well in windows but in Linux, it returns tread sleep error.
#<Thread:0x000055c9febc5ca0 sleep> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
stack level too deep (SystemStackError)
^C*** stack smashing detected ***: <unknown> terminated
code:-
require 'ibm_db'
conn = IBM_DB.connect('DATABASE=;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=;PWD=','','')
puts 'this is ibm_db'
#Thread.report_on_exception = false
puts 'this is begin'
puts IBM_DB
serverinfo = IBM_DB::server_info( conn )
puts serverinfo.DBMS_NAME[0,100]
puts IBM_DB.close(conn)
why the same code returns the error in Linux but woe=rks well in windows.
When I run the code in debug mode it does not produce any error only in normal mode it produces an error.
Thanks, Akhil
Well, two approach
In your case, need to check in ibm_db gem how to check if connection established or not
if it says "TRUE" go ahead else pause/sleep whatever your requirement.