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

dpiSubscr_prepareStmt doesn't increment openChildCount. #27

Closed
kubo opened this Issue Aug 14, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@kubo
Copy link

kubo commented Aug 14, 2017

dpiSubscr_prepareStmt doesn't increment openChildCount in dpiConn.
It should be incremented as dpiConn_prepareStmt does.
Or it should not be decremented when a dpiStmt created by dpiSubscr_prepareStmt is closed.

@kubo

This comment has been minimized.

Copy link
Author

kubo commented Aug 15, 2017

I made a test code about this issue.
https://gist.github.com/kubo/394af98c4c541b2e069467a97f0aaec9
This is also a test code about #28.

dpiConn_close at line 64 got the error "DPI-1054: connection cannot be closed when open statements or LOBs exist". However the statement created by dpiSubscr_prepareStmt was closed and no LOBs were created.

Here is debug outout:

$ DPI_DEBUG_LEVEL=6 ./subscr-test
ODPI: fn dpiContext_initCommonCreateParams(0x19bac20)
ODPI: fn dpiConn_create(0x19bac20)
ODPI: ref 0x19bac40 (dpiConn) -> 1 [NEW]
ODPI: fn dpiContext_initSubscrCreateParams(0x19bac20)
ODPI: fn dpiConn_newSubscription(0x19bac40)
ODPI: ref 0x1a4d100 (dpiSubscr) -> 1 [NEW]
ODPI: ref 0x19bac40 (dpiConn) -> 2
The next 4 bytes of subscrId.id were overwritten with 0x00000000.
ODPI: fn dpiSubscr_prepareStmt(0x1a4d100)
ODPI: ref 0x1a6e3c0 (dpiStmt) -> 1 [NEW]
ODPI: ref 0x19bac40 (dpiConn) -> 3
ODPI: fn dpiStmt_close(0x1a6e3c0)
ODPI: open child on conn 0x19bac40 -> -1
ODPI: ref 0x19bac40 (dpiConn) -> 2
ODPI: fn dpiStmt_release(0x1a6e3c0)
ODPI: ref 0x1a6e3c0 (dpiStmt) -> 0
ODPI: fn dpiSubscr_close(0x1a4d100)
ODPI: fn dpiSubscr_release(0x1a4d100)
ODPI: ref 0x1a4d100 (dpiSubscr) -> 0
ODPI: ref 0x19bac40 (dpiConn) -> 1
ODPI: fn dpiConn_close(0x19bac40)
ERROR at line 64
  dpiConn_close(conn, DPI_MODE_CONN_CLOSE_DEFAULT, NULL, 0)
  DPI-1054: connection cannot be closed when open statements or LOBs exist
@anthony-tuininga

This comment has been minimized.

Copy link
Member

anthony-tuininga commented Aug 15, 2017

Good point. I'll have this corrected.

@anthony-tuininga

This comment has been minimized.

Copy link
Member

anthony-tuininga commented Aug 15, 2017

Thanks for the test case. This issue should now be resolved.

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