0

Contents of procedure - Just two direct insert statements which are inserted through IN parameters. The procedure will be hit every second when a row has to be inserted. It's kind of a recharge. If you recharge, the details will be sent by some other team to us thru java (callable statement). Normally when CPU is low, for a second we can see 10-15 sessions for that procedure (in v$session) and data will be inserted perfectly. When CPU is a bit high, we are able to see 80-90 sessions at once, where every session becomes invalid after 2,3 seconds. it takes time to insert and gets timed out eventually in java in other system.

I hope I made clear on this. Is there any other way to rectify this issue. Other than thru a procedure. I tried with RECORD concept in pl/sql, but nothing happened really.

My procedure just looks like this.

create procedure procedure_name (co1 IN varchar , col2 IN vvarchar.... col15 IN varchar)
x varchar2,
y varchar2,
z varchar2,
.
.
.
begin
x:=col1;
y:=col2;
.
.
.
insert into table1 (column1, column2 ,...) values (x,y,z..); commit;

if (x=15) then

insert into table2(column1,column2,..) values (x,y,z); commit;
exception
when others
..
end;
Jacob
  • 14,463
  • 65
  • 207
  • 320
user1720827
  • 137
  • 1
  • 3
  • 15

1 Answers1

0

The java connection should be pooled to avoid such inconvenience. Probably your database cannot hold so many connection at a time because memory she has access to is limited.

Depending on your java architecture, you should find out how to pool your connections to avoid having one per user. Maybe you can start from here: http://docs.oracle.com/cd/B10500_01/java.920/a96654/connpoca.htm

Otherwise, it looks like your question is for DBA. Have you tried asking it on https://dba.stackexchange.com/?

Good luck - for now I think you find something to improve your user experience anyway.

Community
  • 1
  • 1
J. Chomel
  • 8,193
  • 15
  • 41
  • 69