ODBC Fails on Server

sviardot

sviardot

Reputable Poster
We have connected OW to a AS 400 World's instance using an ODBC's BSFN (ligth modified from source on ocode.net). it's work fine on client (200 workstation ) but fail on the server (2000).
The administrator have check than the odbc DSN is correct and i could find any reason of this failure.
Any Proposition ?
 
Please provide more details.

1- Where does it fail?
2- Are there any error message/number associated with the error?
3- What user runs the services on the server? Does it have access to the iSeries?
4- Does the JDB_GetPassword effectively returns a valid password on the server?

Try activating the iSeries Logging facility to get more info about the error...

Good luck!
 
Ok
the user for the connection is hard coded and it's the same than in client (which's well worked ... ).
I use the iseries connection and it seems than the connection is in fault. i Joined the two log file that i had.
Any help will be pleased.
 

Attachments

  • 74701-Trace.txt
    5.9 KB · Views: 103
Serge,

There was only one attachment. I tried to open it in Notepad, in Wordpad as well as in the iSeries diagnostic tool. I can see some function names (looks like this is the entry point trace), but I cannot interpret the data.

Could you try to send it again, under a zip file?

You can also contact me using a private message and the result of the troubleshooting could be posted back on the list so others can benefit from the experience.


(...)
Je suis à contrat chez EDS Canada, qui est situé au 16ième étage du même édifice que Cap Gemini, Ernst & Young... Si vous avez un WAN, on pourrait en faire usage :)
 
from a windows 2k workstation, it's work ( connect to as 400) as indicated by log.
from a windows 2k server, it fail as indicated by the other log.
 
The iSeries log from the server looks clean to me...

Since there is no ODBC type call in the log, it looks like there is a native windows call that failed.

You should write any ODBC error to the JDE log using the following call:

jdeVWriteLogEntry("ODBC Bsfn",__FILE__, __LINE__, 0, "Error Calling function ABC. Return code is : %u",iReturnCode);

Make sure that the return code is unsigned, otherwise change the %u according to the format specifications found in the documentation of printf.
 
I'm not familiar with this log format. Would you mind using the ODBC tracing tool? It's in the ODBC Data Source Administer. The same place you create DSNs.

Thanks,
 
I use the wite to jdelog Api and then i finally locate the trouble :
the call to SQLAllocHandle fails provoque a memory violation.
As this's our production server, we have no application to test the odbc connection.
Is it a way to use this one by using a windows 2000 server's tool ?
 
the first one :
retcode =SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &EnvironmentHandle);
 
Well, that just happens to be the very first ODBC call in the world. Since that fails I'm guessing that your server is not running a very recent version of ODBC. The code your running is meant for version 3.x. If your server is running a 2.x version (or older) you're going to have to fall back to older code, but I'm afraid I don't have anything for you.

If you are running 3.x ODBC then you may have a permissions issue, but I haven't run this code on a win2k server, so I don't know what settings would need to change.

I'm curious about what the return code is from the function call. Can you determine that?
 
I check the ODBC DLL on server and workstation. They show the same version wich is like 3.2.
The only code error i received is an return code of 99 in the jdedebug.log but no error on odbc trace as hte first call fails.

I continue my test by report the coe into a windows application. When i try ythis application on the server, i work perfectly fine, i was able to write oir read on tables.
So, it seems than the problem is not directly on odbc statement but more on relation beetween JDE and Windows API. I continue to investigate.
 
I try to reproduce the trouble on my own plateform and everything seems to work fine even if i use the same memory model tha JDE (one bit alignement).
And then i get a question : should it be a question of security to access the regsitry or other component ?
 
Re: ODBC Fails on Server -- Memory Alignment issue?

What is the byte alignment of the Microsoft DLL's ? Lets assume it's 8. What if you define ODBC structures (handles, etc) as packed 1? Would it create a possible misalignment between the structure in the BSFN vs the one the ODBC Dll's really read? If so, you have to instruct the compiler that the ODBC dll structures should be aligned to 8 bytes.

I've had a similar problem in the past. I had to call up JDE Business functions from a foreign process running as a windows service. I was using Client Access data queue API's on one side (8 bit alignment) calling up JD system functions (JDB_OpenTable, Etc) on the other side (1 bit). I had to compile the service packed in 8 bits (standard alignment) with the "#pragma pack" instruction on targeted parts of the code.

This is done by issuing the following statement prior to each structure declaration:

/* Begin : Push current packing and force 8 bits
#pragma push
#pragma pack 8
/* ------ Define ODBC Structures here -----
ODBC_CALL_DATA_STRUCT_TYPE dsODBC_CallStructure={0};
ODBC_CALL_DATA_STRUCT_TYPE dsODBC_OtherCallStructure={0};
/* End : Restore alignment
#pragma pop


/* Begin : Push current packing and force 8 bits
#pragma push
#pragma pack 8
/* ------ Include ODBC header files here --
#include <ODBCHeaders.h>
/* End : Restore alignment
#pragma pop

After I completed the code modification, I installed the service and it runs perfectly since then (3 years ago, windows NT 4.0).

For more information on the pack compiler directive:
http://tinyurl.com/2b9yo

Salutations sinceres!

Sebastien Leclerc
 
Re: ODBC Fails on Server -- Administrator privilege for the JDE Queue Service

The registry access privileges are determined by the user who runs the JD Edwards network queue kernel, since it is responsible for running the business functions on the server.

As long as this user has full privileges on the server, the full registry access should be granted.
 
Re: ODBC Fails on Server -- Administrator privilege for the JDE Queue Service

today i try the two hypothesis :
It's not a problem a registry as a full right profil fail again.
It's not also a problem of byte alignement as i use a prgama directive and fail again.
I made a thid test by deploying a client package on our citrix server. And then it work. So the solution appear clear : it's one of our drective of compilation wich is the cause of trouble.
So let's investigate.
 
What is the ERROR NUMBER of the first ODBC call that fails?
 
I can't get any error message as there is a memory violation and the process break down . The only information i see in a one of the jdelog is a return code of 99.
 
Back
Top