You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the following code to test performance [Use p(1000), for example]. But after some successful operations, server rejects further insertions with ORA-01000 error.
Please tell me what is wrong. Thanks.
p_p(N,OciSession) ->
S=iolist_to_binary(["insert into test_2 values(",integer_to_list(N),",",integer_to_list(N),")"]),
Stmt=OciSession:prep_sql(S),
io:format("~p |-~p--| pn",[S,Stmt,Stmt:exec_stmt()]),
case Stmt:close() of
ok ->
io:format("Statement close ok!~n");
Err ->
io:format("Statement close err:pn",[Err])
end.
You may experimentally find a lower value of N in alter system set open_cursors=N... (p(M)) for N < M. But that will depend on the latency between Stmt:exec_stmt/0 <-> Stmt:close/0. Which IMHO may be difficult to formulate.
Please write back if you are still experiencing problem.
I used the following code to test performance [Use p(1000), for example]. But after some successful operations, server rejects further insertions with ORA-01000 error.
Please tell me what is wrong. Thanks.
t.erl:
-module(t).
-export([p/1,p_p/2]).
p(N) ->
application:start(erloci),
OciPort = erloci:new([{logging, false}]),
Tns= <<"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=10.143.132.100)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=bimstest)))">>,
User= <<"bill">>,
Pswd= <<"bill123">>,
OciSession = OciPort:get_session(Tns, User, Pswd),
process_flag(trap_exit, true),
p_create(N,OciSession),
p_exit(N).
p_create(0,_) ->
ok;
p_create(N,OciSession) ->
spawn_link(?MODULE,p_p,[N,OciSession]),
p_create(N-1,OciSession).
p_p(N,OciSession) ->
S=iolist_to_binary(["insert into test_2 values(",integer_to_list(N),",",integer_to_list(N),")"]),
Stmt=OciSession:prep_sql(S),
io:format("~p |-~p--|
pn",[S,Stmt,Stmt:exec_stmt()]),case Stmt:close() of
ok ->
io:format("Statement close ok!~n");
Err ->
io:format("Statement close err:
pn",[Err])end.
p_exit(0) ->
ok;
p_exit(N) ->
receive
{'EXIT',_FromPid,_Reason} ->
p_exit(N-1);
_ ->
p_exit(N)
end.
The text was updated successfully, but these errors were encountered: