Skip to content
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

OCI_GetTimeout() always returns 0 since v4.7.0 #326

Closed
inPhraZ opened this issue Feb 8, 2023 · 11 comments
Closed

OCI_GetTimeout() always returns 0 since v4.7.0 #326

inPhraZ opened this issue Feb 8, 2023 · 11 comments

Comments

@inPhraZ
Copy link

inPhraZ commented Feb 8, 2023

After calling SetTimeout I expect GetTimeout to return 1000. but the return value is 0.

platform and version:

  • OS: ubuntu-server-22.04.1
  • architecture: x86_64
  • Compiler: gcc10
  • Oracle instant client: 19.18.0.0.0
  • ocilib: 4.7.4

here is my code:

ocilib::Connection _con;
unsigned int _wt = 1000;

_con.Open(_sid, _user, _password);
_con.SetTimeout(ocilib::Connection::TimeoutType::Type::TimeoutSend, _wt);
_con.SetTimeout(ocilib::Connection::TimeoutType::Type::TimeoutReceive, _wt);
std::this_thread::sleep_for(std::chrono::seconds(1));

std::cout << "TimeoutSend: " << _con.GetTimeout(ocilib::Connection::TimeoutType::Type::TimeoutSend) << std::endl;
std::cout << "TimeoutReceive: " << _con.GetTimeout(ocilib::Connection::TimeoutType::Type::TimeoutReceive) << std::endl;

output:

TimeoutSend: 0
TimeoutReceive: 0
@vrogier
Copy link
Owner

vrogier commented Feb 8, 2023

Hi,

can you report the return values of the following calls ?

Environment::GetCompileMajorVersion()
Environment::GetRuntimeMajorVersion()
con.GetServerMajorVersion()
con.GetServerMinorVersion()
con.GetServerRevisionVersion()
con.GetVersion()

Regards,

Vincent

@vrogier vrogier self-assigned this Feb 8, 2023
@vrogier
Copy link
Owner

vrogier commented Feb 8, 2023

And also :

Environment::GetCompileVersion()
Environment::GetRuntimeVersion()

@inPhraZ
Copy link
Author

inPhraZ commented Feb 8, 2023

Hi
here is the result:

GetCompileMajorVersion: 18
GetRuntimeMajorVersion: 18
GetCompileVersion: 180100
GetRuntimeVersion: 180300
con.GetServerMajorVersion: 19
con.GetServerMinorVersion: 11
con.GetServerRevisionVersion: 0
con.GetVersion: 180300

@vrogier
Copy link
Owner

vrogier commented Feb 8, 2023

Hi,

I found the issue, a bug introduced few versions ago :(
I will fix this asap in a v4.7.6 branch.

Regards,

Vincent

@vrogier
Copy link
Owner

vrogier commented Feb 8, 2023

I fixed my bug and I was testing the different timeout types (send, receive and call)
It works now with send and call types (oracle returns the correct value previously set) but for receive type the oracle client does not fill input the variable content that should receive the value ....
I have to determine if the value for receive type is taken into account when set and if its just the oracle client getter call for this attribute that has a bug. In this case, I can store theses values in the connection object instead of relying solely on the oracle client.
.
I will reach out to this weird behavior by with 21c client to oracle folks.

@vrogier
Copy link
Owner

vrogier commented Feb 8, 2023

regression introduced in v4.7.0
Fix will be committed this evening in v4.7.6 branch
Still investigating weird OCI client behavior when getting the receive timeout

@vrogier vrogier changed the title setTimeout does not work OCI_GetTimeout() always returns 0 since v4.7.0 Feb 8, 2023
vrogier pushed a commit that referenced this issue Feb 8, 2023
@vrogier
Copy link
Owner

vrogier commented Feb 8, 2023

Did some more testing and it seems that there is an issue in the Oracle client (at least, the one I am using windows 64bit 21.3)

@vrogier
Copy link
Owner

vrogier commented Feb 9, 2023

Hi,

v4.7.6 released.

I am waiting for feedback from Oracle about the receive timeout retrieval that does not work with 21C.

Regards,

Vincent

@inPhraZ
Copy link
Author

inPhraZ commented Feb 10, 2023

Thank you Vincent, I appreciate your efforts.

@vrogier
Copy link
Owner

vrogier commented Feb 13, 2023

@inPhraZ If you initialize OCILIB in threaded mode ( Environment::Initialize(Environment::Threaded) ), then retrieving receive timeout works.
It seems that OCI client returns the receive timeout only if it has been initialized in threaded mode, while for other timeouts, it makes no difference.
I have send some pure OCI test case demoing the issue to Oracle. So, for me, the issue is still on the OCI client side.
I will update this issue once I get feedback from Oracle.

Regards,

Vincent

@inPhraZ
Copy link
Author

inPhraZ commented Feb 13, 2023

If you initialize OCILIB in threaded mode ( Environment::Initialize(Environment::Threaded) ), then retrieving receive timeout works.

yes. both send and receive are working well in v4.7.6. (we did test the TimeoutCall and it also works in OCI_18_1)
but it does not apply on previous branches, cause we have been initialized with Environment::Initialize(Environment::Default | Environment::Threaded); since v4.7.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants