-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error getting client version info #156
Comments
|
@kubo thanks for the input! I'm effectively passing |
#include <stdio.h>
#include <string.h>
#include "dpi.h"
int main()
{
dpiContext *context;
dpiErrorInfo errinfo;
dpiVersionInfo ver;
dpiContext_createWithParams(DPI_MAJOR_VERSION, DPI_MINOR_VERSION, NULL, &context, &errinfo);
dpiContext_getClientVersion(context, &ver);
dpiContext_destroy(context);
printf("1st: %d.%d.%d.%d.%d 0x%x\n", ver.versionNum, ver.releaseNum, ver.updateNum, ver.portReleaseNum, ver.portUpdateNum, ver.fullVersionNum);
memset(&ver, 0, sizeof(ver));
dpiContext_createWithParams(DPI_MAJOR_VERSION, DPI_MINOR_VERSION, NULL, &context, &errinfo);
dpiContext_getClientVersion(context, &ver);
dpiContext_destroy(context);
printf("2nd: %d.%d.%d.%d.%d 0x%x\n", ver.versionNum, ver.releaseNum, ver.updateNum, ver.portReleaseNum, ver.portUpdateNum, ver.fullVersionNum);
} This outputted:
|
This may be same problem with #153. |
See #153 - ODPI does not support more than one context at the moment. Create one, and use that everywhere. |
I think the code example uses one context at a time, since it destroys the first one before creating a new one. This also looks like a regression, given that it worked fine on v3.1.2. |
I've been bitten by this again - I want to connect to two different databases from two different environments (TNS_ADMIN, ORACLE_PATH). As confDir and libDir is tied to the Context, I cannot accomplish this task now. |
@tgulacsi, are you suggesting that you could in the past? The environment variables (like |
No, I couldn't. The following change (save ClientVersionInfo and reuse it) solves the SIGSEGV. But you're right, it still doesn't work, instead of SIGSEGV, I get "invalid username/password".
|
@anthony-tuininga , can you confirm that with the current state of OCI libraries, one cannot change libDir and configDir (ORACLE_PATH, TNS_ADMIN) once connected to a database? That negative answer may also help, as I'll try to find an alternate solution, and not force this in one process. |
Yes, once you have connected to a database you cannot change the values of the library directory and configuration directory. To be more precise, once I also see the problem with creating multiple contexts and the client version information. I'll address that and add a test case to ensure that the problem truly is resolved. Thanks for diagnosing the issue! |
I've just pushed changes to correct this issue and added a test case as well. |
Thanks, I can confirm those fixes work for me! |
I can confirm it works also:
|
@anthony-tuininga , maybe I missed something in the commit history, but I guess these should be fixed in the docs:
|
You are correct, @felipenoris! I think those were copy/paste errors that simply never got caught before. Thanks! |
ODPI-C 4.2 has been released which contains the patch for this issue. Thanks, everyone, for your help in uncovering this issue! |
Hi!
I took some time to upgrade Oracle.jl dependency from odpi v3.1.2 to the latest v4.1.
Everything worked flawless, except getting the client version info using
dpiContext_getClientVersion
.After debugging a bit, I found a few things outdated in the docs:
structure dpiVersionInfo
fullVersionNum
is now auint32
dpiContext_getClientVersion returns
int
instead ofvoid
Even after these corrections, I can't get this function to work. This is what I'm getting from it:
When I query the server version, which shares the same dpiVersionInfo struct, I get the expected result:
Can you check that
dpiContext_getClientVersion
is working correctly?The text was updated successfully, but these errors were encountered: