Topic
  • 4 replies
  • Latest Post - ‏2012-05-23T10:54:24Z by SystemAdmin
SystemAdmin
SystemAdmin
115 Posts

Pinned topic Old Client Library requirement

‏2012-05-17T10:52:18Z |
Hi,

I have a legacy application built and running on SunOS 5.9 (SUNW,Ultra-80,sparc) that connects to a legacy 4.0.25 soliddb server again SunOS 5.9 (SUNW,Ultra-80,sparc). I'm porting it to Linux (2.6.18-194.17.1.el5, x86_64, RHEL 5.6). The app compiles just fine and is able to connect to the server, running the query just fine. The issue arises when the SQLFetch method tries to get the 3rd result. This starts to wait on the server, waiting for results, not returning.

An strace of the client gives me the following output:


[tools@dc2-owras04 new_solid]$ strace -f -F -ff -e trace=network,poll ./solidconn 1313 connecting to 
'tcp -r0 localhost 1313' as admin:admin socket(PF_FILE, SOCK_STREAM, 0)         = 3 connect(3, 
{sa_family=AF_FILE, path=
"/var/run/nscd/socket"...
}, 110) = -1 ENOENT (No such file or directory) socket(PF_FILE, SOCK_STREAM, 0)         = 3 connect(3, 
{sa_family=AF_FILE, path=
"/var/run/nscd/socket"...
}, 110) = -1 ENOENT (No such file or directory) socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0 connect(3, 
{sa_family=AF_INET, sin_port=htons(1313), sin_addr=inet_addr(
"127.0.0.1")
}, 16) = 0 getsockname(3, 
{sa_family=AF_INET, sin_port=htons(37439), sin_addr=inet_addr(
"127.0.0.1")
}, [4580723779579150352]) = 0 sendto(3, 
"\2\0\0\1\0\r\0\1\0\0\0\4\3\2\1\6\0\0\0\1\0\0\0\5\0\0\0ADMIN"..., 192, 0, NULL, 0) = 192 poll([
{fd=3, events=POLLIN
}], 1, 1000)  = 1 ([
{fd=3, revents=POLLIN
}]) recvfrom(3, 
"\2\0\1\0\0\0\0\1\0\0\0!\0\0\0\374\267\240\16\0\0\0\0\2\0\0\0\4\0\0\0\3"..., 4096, 0, NULL, NULL) = 157 sendto(3, 
"\2\0\0\1\0\17\0\2\0\0\0!\0\0\0\374\267\240\16\0\0\0\0\35\0\0\0SELEC"..., 77, 0, NULL, 0) = 77 poll([
{fd=3, events=POLLIN
}], 1, 1000)  = 1 ([
{fd=3, revents=POLLIN
}]) recvfrom(3, 
"\2\0\1\0\0\0\0\2\0\0\0!\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\0"..., 4096, 0, NULL, NULL) = 150 sendto(3, 
"\2\0\0\1\0\24\0\3\0\0\0!\0\0\0\374\267\240\16\1\0\0\0\0\0\0\0\1\377\377\377\377"..., 51, 0, NULL, 0) = 51 poll([
{fd=3, events=POLLIN
}], 1, 1000)  = 1 ([
{fd=3, revents=POLLIN
}]) recvfrom(3, 
"\2\0\1\0\0\0\0\3\0\0\0!\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\2616\0\0\0"..., 4096, 0, NULL, NULL) = 140 ExecDirect: Success Starting Fetch: Done. Fetch: Success iteration 1 GetCol: Success Name: ACCOUNTING_PROFILE Starting Fetch: Done. Fetch: Success iteration 2 GetCol: Success Name: ACCOUNTING_PROPOSAL Starting Fetch: sendto(3, 
"\2\0\0\1\0\25\0\4\0\0\0!\0\0\0\374\267\240\16\2\0\0\0\0\0\0\0\1\0\0\0\0"..., 40, 0, NULL, 0) = 40 poll([
{fd=3, events=POLLIN
}], 1, 1000)  = 1 ([
{fd=3, revents=POLLIN
}]) recvfrom(3, 
"\2\0\1\374\377\374\377\4\0\0\0NOSUP", 4096, 0, NULL, NULL) = 16 poll([
{fd=3, events=POLLIN
}], 1, 1000)  = 0 (Timeout)

The relavant source snippet (of fetch and execute) is as follows:


rc = SQLAllocStmt(hdbc, &hstmt); 
//local::strerror(henv,hdbc,rc,"AllocStmt");   rc = SQLExecDirect(hstmt, (unsigned char*)
"SELECT TABLE_NAME FROM TABLES", SQL_NTS); local::strerror(henv,hdbc,rc,
"ExecDirect");   std::cout<<
"Starting Fetch: "<<std::flush; rc = SQLFetch(hstmt); std::cout<<
"Done."<<std::endl; 

int i=1; 

while(rc!=SQL_NO_DATA_FOUND) 
{ local::strerror(henv,hdbc,rc,
"Fetch"); std::cout<<
"iteration "<<i<<std::endl;   rc = SQLGetCol(hstmt, 1, SQL_C_CHAR, &name, sizeof(name), &count); local::strerror(henv,hdbc,rc,
"GetCol");   std::cout<<
"Name: "<<name<<std::endl; std::cout<<
"Starting Fetch: "<<std::flush; rc = SQLFetch(hstmt); std::cout<<
"Done."<<std::endl; ++i; 
} std::cout<<
"Exit Loop."<<std::endl; local::strerror(henv,hdbc,rc,
"Fetch");   rc = SQLFreeStmt(hstmt, SQL_DROP); local::strerror(henv,hdbc,rc,
"FreeStmt");

Any pointers to solve this problem would be appreciated.
Updated on 2012-05-23T10:54:24Z at 2012-05-23T10:54:24Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    115 Posts

    Re: Old Client Library requirement

    ‏2012-05-22T10:05:14Z  
    Hi,

    The last recvfrom() has a potential clue in it:

    recvfrom(3, "\2\0\1\374\377\374\377\4\0\0\0NOSUP", 4096, 0, NULL, NULL) = 16

    Namely, the "NOSUP". Are your client libraries the same version as the server? Newer clients are not supported by the server.

    There isn't a build of Solid 4.0 for 64-bit Linux. The 32-bit version may or may not work for you (also forces your application to be 32-bit). It was certified for the ancient RedHat 9 but RHEL 5.6 is a very different beast.

    Regards,
    Mikko
  • SystemAdmin
    SystemAdmin
    115 Posts

    Re: Old Client Library requirement

    ‏2012-05-22T12:40:44Z  
    Hi,

    The last recvfrom() has a potential clue in it:

    recvfrom(3, "\2\0\1\374\377\374\377\4\0\0\0NOSUP", 4096, 0, NULL, NULL) = 16

    Namely, the "NOSUP". Are your client libraries the same version as the server? Newer clients are not supported by the server.

    There isn't a build of Solid 4.0 for 64-bit Linux. The 32-bit version may or may not work for you (also forces your application to be 32-bit). It was certified for the ancient RedHat 9 but RHEL 5.6 is a very different beast.

    Regards,
    Mikko
    Yes, that is what I figured as well. However, the client returns the first 2 results, and the server-client communication isn't a complete washout. That is the incomprehensible part of the puzzle. Why does the client library correctly interact with the server on the initial send-recvfrom cycle, yet fails on the 2nd partial fetch. And that is the gist of my problem.
  • SystemAdmin
    SystemAdmin
    115 Posts

    Re: Old Client Library requirement

    ‏2012-05-22T12:48:44Z  
    Yes, that is what I figured as well. However, the client returns the first 2 results, and the server-client communication isn't a complete washout. That is the incomprehensible part of the puzzle. Why does the client library correctly interact with the server on the initial send-recvfrom cycle, yet fails on the 2nd partial fetch. And that is the gist of my problem.
    (I cannot seem to edit my post, thus this 2nd consecutive post). The client Library I used to connect is 6.1.18, which connects to the server well enough.

    As for my application, I don't have a requirement for 64 bit, and I can as easily with a 32bit compiled binary. Further certification isn't really needed, from my viewpoint. As long as it works in most cases, my requirements are met. The problem lies in obtaining the client libraries/headers for version 4.0.25 for 32bit linux. I searched all over the IBM support site, but I have not found any package for any version earlier than 4.5.167.
  • SystemAdmin
    SystemAdmin
    115 Posts

    Re: Old Client Library requirement

    ‏2012-05-23T10:54:24Z  
    (I cannot seem to edit my post, thus this 2nd consecutive post). The client Library I used to connect is 6.1.18, which connects to the server well enough.

    As for my application, I don't have a requirement for 64 bit, and I can as easily with a 32bit compiled binary. Further certification isn't really needed, from my viewpoint. As long as it works in most cases, my requirements are met. The problem lies in obtaining the client libraries/headers for version 4.0.25 for 32bit linux. I searched all over the IBM support site, but I have not found any package for any version earlier than 4.5.167.
    Yes, what seems to be happening is that Execute brings along the first couple of rows but things fail when the client goes back and asks the server for more. So something has changed there between 4.0 and 6.1.

    Unfortunately 4.5 is the oldest available version of solidDB from IBM. You may have better luck with it than with 6.1 client, but there is no guarantee of that.

    solidDB End-of-Life documentation.