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

exec_stmt blocking call. #29

Open
acautin opened this issue Nov 24, 2016 · 0 comments
Open

exec_stmt blocking call. #29

acautin opened this issue Nov 24, 2016 · 0 comments
Assignees
Labels

Comments

@acautin
Copy link
Contributor

acautin commented Nov 24, 2016

We stumbled upon a problem when one of the tables was blocked by a non terminated transaction. The call to exec_stmt will never finish
and after login out of dderl ocierl.exe was hanging around even after restarting the service with the table locked (was not able to reproduce that
locally on os x).

I tried creating a table with only one column and then added rows 1 & 2:

OciPort = erloci:new([{logging, true}, {env, [{"NLS_LANG", "GERMAN_SWITZERLAND.AL32UTF8"}]}]).
OciSession = OciPort:get_session(<<"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=XX.XX.XXX.XXX)(PORT=XXXX)))(CONNECT_DATA=(SERVICE_NAME=XE)))">>,
<<"user">>, <<"pass">>).
CreateTable = <<"create table test (COL1 int)">>.
CreateStmt = OciSession:prep_sql(CreateTable).
CreateStmt:exec_stmt().

Then in 2 separated vms executed:

DeleteRow = <<"delete from test where COL1 = :SOMEVAR">>.
DeleteStmt = OciSession:prep_sql(DeleteRow).
DeleteStmt:bind_vars([{<<":SOMEVAR">>, 'SQLT_STR'}]).
DeleteStmt:exec_stmt([{<<"2">>}],0).

On the first one I got:

([email protected])43> DeleteStmt:exec_stmt([{<<"2">>}],0).
23.11.2016 19:44:30.520476 [debug] [_OCI_] {c_src/erloci_drv/command.cpp,exec_stmt,525} Bounds 
{rowids,[<<"AAAU99AABAAALJxAAA">>]}

But the second one was a blocking call, maybe this is the expected behavior when a transaction can't be completed ?

c-bik pushed a commit that referenced this issue Apr 16, 2017
@c-bik c-bik self-assigned this Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants