Comments (8)
Hi,
To be honest, I have never tried this workflow (get sql identifier on scrollable cursors).
I will investigate that asap.
Regards,
Vincent
from ocilib.
@vrogier an OCI testcase would help us.
@cjbj Here it is :)
When executing this pure OCI test case with exec_mode = OCI_DEFAULT, SQL ID can be retrieved after any (re)execution if the same prepared statement.
When executing it with exe_mode = OCI_STMT_SCROLLABLE_READONLY, SQL ID is retrieved after the 1st execution and then no value returned for subsequent executions of same prepared statement.
I aggree this worflow might not make sense. But is this behavior an expected one ?
test_case_oci_issue_get_sql_id_scrollable_cursor.txt
from ocilib.
@cjbj i discovered this by accident while playing around with prepared statements and resultsets - i don't have any usecase - yet
from ocilib.
We'll send the testcase to our bug-analysis group and let them handle it.
from ocilib.
Hi,
I did have a look at it.
Every time a statement is executed and if the OCI client supports it, OCILIB retrieves the SQL ID of the just executed statement from the OCI client library (OCILIB behavior could be optimized to only do it after the 1st execution of a given statement but that's another topic).
There is indeed a behavior difference between using or not using scrollable cursors.
When not using scrollable cursors, every time OCILIB asks the OCI client for the SQL ID of the same executed statement, it gets the same values (value content and value size).
When using scrollable cursors, during the 1st attempt to get the SQL ID, OCILIB gets the SQL ID content and size from OCI. After re execution, OCILIB asks again the SQLID content and size. OCI client returns the same size as for the 1st execution but it does not fill the content :(
@cjbj It seems that querying the attribute OCI_ATTR_SQL_ID on the OCI_HTYPE_STMT after a executing statement wirh mode flags OCI_STMT_SCROLLABLE_READONLY has a weird behavior
- first execution : works fine and OCIAttrGet() returns a value and a size
- later execution : same size is returned but value is not !
@unficyp I guess if OCILIB was querying the SQL ID only after the first execution, it will solve the issue (as OCI client has a weird behavior for subsequent calls). I will create a v4.7.7 bfranch with this change.
Regards,
Vincent
from ocilib.
Created v4.7.7 branch with the optimization that computes the SQL ID only once.
I am still questioning the OCI client behavior (the issue could be in OCILIB usage of the OCI API but regarding current documentation of OCI API, I am more thinking that the issue is on OCI side).
Regards,
Vincent
from ocilib.
@vrogier an OCI testcase would help us.
from ocilib.
@unficyp What you are doing with scrollable cursors. How many rows are in your queries? How long do you hold the cursors open? I'm interested to know your usage & design pattern. Sure scrollable cursors have their place, but they do tie up server resources.
from ocilib.
Related Issues (20)
- Cancel/Terminate/Stop connection request HOT 2
- C++ API: Exception GetMessage HOT 3
- OCI_SubscriptionRegister() generates a segfault on failure HOT 7
- ocilib::Lob::GetConnection() does not compile anymore HOT 7
- OCI_GetTimeout() always returns 0 since v4.7.0 HOT 11
- Strange behaviour with XMLTYPE HOT 23
- OCI_TypeInfoGet() : In case of failure, newly created OCI_TypeInfo object is not removed from OCI_Connection internal cache
- OCI_GetServerMajorVersion() returns wrong values for Oracle Server version < 18.1 HOT 1
- OCI_RefToText() return garbage when charset is OCI_CHARSET_WIDE HOT 1
- Error occurred at OcilibEnvironmentInitialize: Cannot load OCI shared library (oci.dll) HOT 4
- Error occurred at OcilibResultsetFetchFirst: A null Resultset handle has been provided HOT 5
- Regarding the use of connection pool to obtain links, will it be automatically recycled by connection pool? HOT 1
- I don't know why I suddenly reported this error: ocilib\include\ocilibcpp\detail\exception.hpp(92): error C2061: syntax error: identifier 'nothrow' HOT 1
- Regarding using ocilib::Pool to get links ,what happens if the maximum link is reached? HOT 1
- symbol not found in flat namespace '_OCIAQDeq' (macOS arm64) HOT 3
- Wrapper for OCINlsGetInfo() HOT 1
- On connection pool problem HOT 6
- On the limitation of the number of preprocessing bindings? HOT 1
- Why does ocilib::Resultset restrict the default construct? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ocilib.