WWV_FLOW_COLLECTIONS_UK
Hi,
I have a collection, created on page load.
When the I open multiple tabs with this page very quickly (cntr + multiple quick clicks) I get - WWV_FLOW_COLLECTIONS_UK
While creating the collection I use - create_or_truncate_collection
Is there any way to get arround this issue ?
Thanks
Machan,
try
pseudo code..
if collection exists then
truncate collection
else
create collection
end;some how it works though is should be effectively same as create_or_truncate_collection
Regards,
Hari
Similar Messages
-
Issue: ORA-00001: unique constraint (APEX_030200.WWV_FLOW_COLLECTIONS_UK) violated when using APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
Error ERR-1101 Unable to process function body returning query
Note that I am not able to reproduce this problem every time. It is very rare and occurs once in a week or two weeks.
I get this error when I call following procedure using APEX page having interactive report.
======================================================================
PROCEDURE create_collection(p_collection IN VARCHAR2, p_reset IN VARCHAR2 DEFAULT 'N')
AS
BEGIN
IF p_reset = 'Y' THEN
APEX_COLLECTION.DELETE_COLLECTION(p_collection_name => p_collection);
END IF;
IF NOT APEX_COLLECTION.COLLECTION_EXISTS(p_collection_name => p_collection)
THEN
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
p_collection_name => p_collection,
p_query =>
q'!SELECT a.view_name,
a.column_name1,
a.column_name2,
b.column_name4,
b.column_name5,
FROM view_A a, table_B b
WHERE a.view_name = b.table_name
ORDER BY a.view_name, b.column_name4!'
END IF;
END;
======================================================================
The procedure call is like: create_columns_collection(p_collection => 'EMP_SAL');
Please help.
Thanks,
AviA collection is unique to a specific APEX session. If you're encountering a unique key violation, then it must be happening for a particular user within their same session. This typically happens when a user attempts to go to a page, the page takes too long to render, so they click refresh on their browser after a couple seconds. Now you have two physically distinct database sessions in the database, each attempting to satisfy the user's page request. Obviously, the end user is going to see the results of only the most recent (second) page request - the results from the first page request will essentially go to /dev/null.
You can see how, if there is collection processing during this page request, that the creation of the collection and population of it could cause two sessions to clobber each other. One way to mitigate this is to serialize access to this page view.
Joel -
Htmldb_collection and db read
Is there a way to force sequential read over scattered read when using htmldb_collection.add_member?
I have traced an issue with response time to the following section of my code:
if length(dcg) > 1 then
htmldb_collection.add_member(
p_collection_name => 'DCGCOLLECTION',
p_c001 => shuttle_rec.obt_seq_id,
p_c002 => dcg,
p_generate_md5 => 'NO');
end if;
Here is what I am seeing in TKPROF (sorry I can not get the execution report section formatted better). I attempted to recreate the same flow each time, but because I can not predict when the different reads will happen it is difficult. Therefore I have cut and pasted the corresponding sections of the two trace and tkprof output files below.
You will see that when the system responds as desired, it is using INDEX RANGE SCAN WWV_FLOW_COLLECTION_MEMBERS_PK and db file sequential read. When response time is slow it uses INDEX FAST FULL SCAN WWV_FLOW_COLLECTION_MEMBERS_PK and db file scattered read.
FAST RESPONSE:
TRACE FILE just enough to show the collection name (value=)
SELECT NVL(MAX(SEQ_ID),0) MAXSEQ FROM WWV_FLOW_COLLECTIONS$ C, WWV_FLOW_COLLECTION_MEMBERS$ M WHERE C.SESSION_ID = V('SESSION') AND C.USER_ID = :B4 AND C.SECURITY_GROUP_ID = :B3 AND C.FLOW_ID = :B2 AND C.ID = M.COLLECTION_ID AND C.COLLECTION_NAME = UPPER(:B1 )
END OF STMT
PARSE #53:c=0,e=81,p=0,cr=0,cu=0,mis=0,r=0,dep=2,og=1,tim=4046522821
BINDS #53:
bind 0: dty=1 mxl=2000(255) mal=00 scl=00 pre=00 oacflg=03 oacfl2=206001 size=2080 offset=0
bfp=091722d4 bln=2000 avl=04 flg=05
value="RICH"
bind 1: dty=2 mxl=22(21) mal=00 scl=00 pre=00 oacflg=03 oacfl2=206001 size=0 offset=2000
bfp=09172aa4 bln=22 avl=09 flg=01
value=1807302131050935
bind 2: dty=2 mxl=22(21) mal=00 scl=00 pre=00 oacflg=03 oacfl2=206001 size=0 offset=2024
bfp=09172abc bln=22 avl=03 flg=01
value=106
bind 3: dty=1 mxl=32(13) mal=00 scl=00 pre=00 oacflg=03 oacfl2=206001 size=0 offset=2048
bfp=09172ad4 bln=32 avl=13 flg=01
value="DCGCOLLECTION"
TKPROF
SELECT NVL(MAX(SEQ_ID),0) MAXSEQ
FROM
WWV_FLOW_COLLECTIONS$ C, WWV_FLOW_COLLECTION_MEMBERS$ M WHERE C.SESSION_ID =
V('SESSION') AND C.USER_ID = :B4 AND C.SECURITY_GROUP_ID = :B3 AND
C.FLOW_ID = :B2 AND C.ID = M.COLLECTION_ID AND C.COLLECTION_NAME =
UPPER(:B1 )
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 226 0.03 0.07 0 0 0 0
Fetch 226 0.01 0.03 3 1145 0 226
total 454 0.04 0.10 3 1145 0 226
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 67 (recursive depth: 2)
Rows Row Source Operation
2 SORT AGGREGATE (cr=10 pr=3 pw=0 time=18198 us)
0 NESTED LOOPS (cr=10 pr=3 pw=0 time=18167 us)
2 TABLE ACCESS BY INDEX ROWID WWV_FLOW_COLLECTIONS$ (cr=4 pr=0 pw=0 time=277 us)
2 INDEX UNIQUE SCAN WWV_FLOW_COLLECTIONS_UK (cr=2 pr=0 pw=0 time=238 us)(object id 52046)
0 INDEX RANGE SCAN WWV_FLOW_COLLECTION_MEMBERS_PK (cr=6 pr=3 pw=0 time=17876 us)(object id 52050)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 3 0.00 0.01
INSERT INTO WWV_FLOW_COLLECTION_MEMBERS$( COLLECTION_ID, SEQ_ID, C001, C002,
C003, C004, C005, C006, C007, C008, C009, C010, C011, C012, C013, C014,
C015, C016, C017, C018, C019, C020, C021, C022, C023, C024, C025, C026,
C027, C028, C029, C030, C031, C032, C033, C034, C035, C036, C037, C038,
C039, C040, C041, C042, C043, C044, C045, C046, C047, C048, C049, C050,
MD5_ORIGINAL )
VALUES
( :B53 , :B52 , :B51 , :B50 , :B49 , :B48 , :B47 , :B46 , :B45 , :B44 , :B43 ,
:B42 , :B41 , :B40 , :B39 , :B38 , :B37 , :B36 , :B35 , :B34 , :B33 , :B32
, :B31 , :B30 , :B29 , :B28 , :B27 , :B26 , :B25 , :B24 , :B23 , :B22 ,
:B21 , :B20 , :B19 , :B18 , :B17 , :B16 , :B15 , :B14 , :B13 , :B12 , :B11 ,
:B10 , :B9 , :B8 , :B7 , :B6 , :B5 , :B4 , :B3 , :B2 , :B1 )
call count cpu elapsed disk query current rows
Parse 1 0.01 0.00 0 0 0 0
Execute 59 0.12 0.12 7 30 311 59
Fetch 0 0.00 0.00 0 0 0 0
total 60 0.14 0.13 7 30 311 59
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 67 (recursive depth: 2)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 6 0.00 0.02
UPDATE WWV_FLOW_COLLECTIONS$ SET COLLECTION_CHANGED = 'Y'
WHERE
ID = :B1 AND COLLECTION_CHANGED = 'N'
call count cpu elapsed disk query current rows
Parse 2 0.01 0.00 0 0 0 0
Execute 226 0.01 0.02 0 452 18 6
Fetch 0 0.00 0.00 0 0 0 0
total 228 0.03 0.03 0 452 18 6
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 67 (recursive depth: 2)
Rows Row Source Operation
2 UPDATE (cr=4 pr=0 pw=0 time=476 us)
2 TABLE ACCESS BY INDEX ROWID WWV_FLOW_COLLECTIONS$ (cr=4 pr=0 pw=0 time=66 us)
2 INDEX UNIQUE SCAN WWV_FLOW_COLLECTIONS_PK (cr=2 pr=0 pw=0 time=38 us)(object id 52045)
SLOW RESPONSE:
TRACE FILE just enough to show the collection name (value=)
SELECT NVL(MAX(SEQ_ID),0) MAXSEQ FROM WWV_FLOW_COLLECTIONS$ C, WWV_FLOW_COLLECTION_MEMBERS$ M WHERE C.SESSION_ID = V('SESSION') AND C.USER_ID = :B4 AND C.SECURITY_GROUP_ID = :B3 AND C.FLOW_ID = :B2 AND C.ID = M.COLLECTION_ID AND C.COLLECTION_NAME = UPPER(:B1 )
END OF STMT
PARSE #39:c=0,e=89,p=0,cr=0,cu=0,mis=0,r=0,dep=2,og=1,tim=1298905691
BINDS #39:
bind 0: dty=1 mxl=2000(255) mal=00 scl=00 pre=00 oacflg=03 oacfl2=206001 size=2080 offset=0
bfp=06250cb8 bln=2000 avl=04 flg=05
value="RICH"
bind 1: dty=2 mxl=22(21) mal=00 scl=00 pre=00 oacflg=03 oacfl2=206001 size=0 offset=2000
bfp=06251488 bln=22 avl=09 flg=01
value=1807302131050935
bind 2: dty=2 mxl=22(21) mal=00 scl=00 pre=00 oacflg=03 oacfl2=206001 size=0 offset=2024
bfp=062514a0 bln=22 avl=03 flg=01
value=106
bind 3: dty=1 mxl=32(13) mal=00 scl=00 pre=00 oacflg=03 oacfl2=206001 size=0 offset=2048
bfp=062514b8 bln=32 avl=13 flg=01
value="DCGCOLLECTION"
TKPROF
SELECT NVL(MAX(SEQ_ID),0) MAXSEQ
FROM
WWV_FLOW_COLLECTIONS$ C, WWV_FLOW_COLLECTION_MEMBERS$ M WHERE C.SESSION_ID =
V('SESSION') AND C.USER_ID = :B4 AND C.SECURITY_GROUP_ID = :B3 AND
C.FLOW_ID = :B2 AND C.ID = M.COLLECTION_ID AND C.COLLECTION_NAME =
UPPER(:B1 )
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 224 0.10 0.06 0 0 0 0
Fetch 224 32.37 603.54 1916959 1923042 0 224
total 449 32.48 603.61 1916959 1923042 0 224
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 67 (recursive depth: 2)
Rows Row Source Operation
224 SORT AGGREGATE (cr=1923042 pr=1916959 pw=0 time=603553959 us)
6160 NESTED LOOPS (cr=1923042 pr=1916959 pw=0 time=73040535 us)
224 TABLE ACCESS BY INDEX ROWID WWV_FLOW_COLLECTIONS$ (cr=448 pr=0 pw=0 time=21810 us)
224 INDEX UNIQUE SCAN WWV_FLOW_COLLECTIONS_UK (cr=224 pr=0 pw=0 time=18572 us)(object id 52046)
6160 INDEX FAST FULL SCAN WWV_FLOW_COLLECTION_MEMBERS_PK (cr=1922594 pr=1916959 pw=0 time=73009271 us)(object id 52050)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file scattered read 124352 0.03 588.32
INSERT INTO WWV_FLOW_COLLECTION_MEMBERS$( COLLECTION_ID, SEQ_ID, C001, C002,
C003, C004, C005, C006, C007, C008, C009, C010, C011, C012, C013, C014,
C015, C016, C017, C018, C019, C020, C021, C022, C023, C024, C025, C026,
C027, C028, C029, C030, C031, C032, C033, C034, C035, C036, C037, C038,
C039, C040, C041, C042, C043, C044, C045, C046, C047, C048, C049, C050,
CLOB001, MD5_ORIGINAL )
VALUES
( :B54 , :B53 , :B52 , :B51 , :B50 , :B49 , :B48 , :B47 , :B46 , :B45 , :B44 ,
:B43 , :B42 , :B41 , :B40 , :B39 , :B38 , :B37 , :B36 , :B35 , :B34 , :B33
, :B32 , :B31 , :B30 , :B29 , :B28 , :B27 , :B26 , :B25 , :B24 , :B23 ,
:B22 , :B21 , :B20 , :B19 , :B18 , :B17 , :B16 , :B15 , :B14 , :B13 , :B12 ,
:B11 , :B10 , :B9 , :B8 , :B7 , :B6 , :B5 , :B4 , :B3 , :B2 , :B1 )
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 224 0.39 0.57 190 11 1319 224
Fetch 0 0.00 0.00 0 0 0 0
total 225 0.39 0.57 190 11 1319 224
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 67 (recursive depth: 2)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 188 0.00 0.06
UPDATE WWV_FLOW_COLLECTIONS$ SET COLLECTION_CHANGED = 'Y'
WHERE
ID = :B1 AND COLLECTION_CHANGED = 'N'
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 224 0.01 0.03 0 448 12 4
Fetch 0 0.00 0.00 0 0 0 0
total 225 0.01 0.03 0 448 12 4
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 67 (recursive depth: 2)
Rows Row Source Operation
4 UPDATE (cr=448 pr=0 pw=0 time=9004 us)
4 TABLE ACCESS BY INDEX ROWID WWV_FLOW_COLLECTIONS$ (cr=448 pr=0 pw=0 time=7205 us)
224 INDEX UNIQUE SCAN WWV_FLOW_COLLECTIONS_PK (cr=224 pr=0 pw=0 time=4003 us)(object id 52045)
Thanks for any help.Vikas,
pga_aggregate_target = 25165824
workarea_size_policy = AUTO
I have not run statistics on all tables in my development database, so I believe I am operating in Rules Based Optimization.
However, all pages running against tables in my database operate fine. It is not until I create an htmldb_collection by running a query against another htmldb_collection that I see slow response times.
Here is an overview of the process, and the steps I went through when tracing:
User logs in and is brought to the main page.
User selects Locate Agreements from a sidebar menu and is sent to a page with reports region built on the AGREEMENTS table (currently 450 rows in development).
User selects Costa Rica from a select list of terminating countries and the page is submitted and refreshed showing only Costa Rica agreements.
User clicks on the Edit link for an agreement and is sent to the details page for the selected record.
Now that a specific agreement has been selected, this page fires the on-demand process load tier collections on load, after footer. This process is viewable by going to http://htmldb.oracle.com/pls/otn/f?p=23228:2:218044503435049191::::: and downloading. Processing time to this point is fine.
User selects Tiers from the sidebar menu and is sent to a page built on the htmldb_collection OBTCOLLECTION which was created by the load tier collections process.
Here is where the delay occurs. This page fires the on-demand process load shuttle collections on load, after footer. This process is viewable by going to http://htmldb.oracle.com/pls/otn/f?p=23228:2:218044503435049191::::: and downloading. This process creates multiple htmldb_collections for use on the next page. Using a cursor to move through the OBTCOLLECTION (created earlier), four fields, each containing semi-colon delimited strings, are parsed and the values are inserted into the appropriate collections (DCGCOLLECTION, CITYCOLLECTION, PRODCOLLECTION, PRDCOLLECTION). It would appear, after looking at the trace files, that the creation of the DCGCOLLECTION is causing the biggest delay. This page will load in seconds when operating correctly, but takes as much as 10 minutes when it is not. I have seen this happen at all times of the day, and there is nothing else (nor anyone else) running on the server.
Richard -
Error ERR-1018 Error clearing step cache
The full error message was:
ORA00001: unique constraint (FLOWS_030000.WWV_FLOW_COLLECTIONS_UK) violated ORA-00060: deadlock detected while waiting for resource
Error ERR-1018 Error clearing step cache
We can't reproduce it (so it would appear to be intermittent and very rare), but it may be significant that it occurred in an unauthenticated application.
Does anyone have any idea about what circumstances would cause this error to occur?
Many thanks for your help.
John.Can't believe that the thread immediately preceding this one when I posted it (the relevant thread is called 'intermittent collection violations') more-or-less answers this question... (and that I didn't find it when searching).
Edited by: John Vaughan on Nov 12, 2008 1:14 PM -
Another collections bug?
Following on from this thread relating to incorrect debug session reporting of collections:
Re: Strange collection errors occuring on only some workstations (apex 2.2.
I am encountering more strange behaviour using collections. I hope its my own programming, however I am increasingly led to believe that something is not quite right within the APEX collections implementation.
I am working within a corporate environment, and my application works fine on the local desktop. However when I try and launch the application from within a Citrix Metaframe desktop, the following error INTERMITTENTLY occurs:
ORA-20104: create_collection_from_query_b Error:ORA-20101: Application collection exists
The url used to launch the application is the base url, so am I correct in thinking a new session should be created? This point is moot however, because on load of my application I explicitly delete all collections and the problem still occurs.
Perhaps the problem lies with using the Citrix desktop, however I think it is more likely that the differences in IE versions are part of this problem.
IE (desktop) version: 6.0.2800.1106.xpsp2.050301-1526CO
IE (citrix desktop) version: 6.0.2800.1106CO
So the obvious difference here is that I have XP-SP2 and the Citrix desktop is running 2000 SP4.
The other intermittent error I get is as follows:
ORA-20104: create_collection_from_query_b Error:ORA-00001: unique constraint (FLOWS_020200.WWV_FLOW_COLLECTIONS_UK) violated
The collection exists of one column and it is a GROUP BY query so duplicates are not possible. Is some other internal field acting as the primary key inside a collection? Or is the collection trying to append to the previous collection? Again, I am very confused because all collections are deleted 'on submit', before the new collection is created.
How can I view this 'FLOWS_020200.WWV_FLOW_COLLECTIONS_UK' value?
Can anyone point me in the right direction?Update:
I have managed to pinpoint the exact sequence of event that causes this error:
ORA-20104: create_collection_from_query_b Error:ORA-00001: unique constraint (FLOWS_020200.WWV_FLOW_COLLECTIONS_UK) violated
Step taken to produce the error:
1.) Launch application from URL
2.) Submit Page 1 (returns a report on the same page)
3.) ORA-20104 as above.
Repeat ad nauseum.
I would like to reiterate that the APEX_COLLECTION.DELETE_ALL_COLLECTIONS_SESSION command is being run on load (even though it should not have to be run.) I know this is executing on load from the process success message.
Does the DELETE_ALL_COLLECTIONS_SESSION statement delete the actual collection or merely the reference to the collection? I must admit I am quite clueless when it comes to the internal workings of oracle.
My next step is to come in tomorrow morning and see if it fails the first time I run it.
If it does run correctly, I would assume that all collections have expired and that DELETE_ALL_COLLECTIONS_SESSION is not doing what it says it is. -
Unusual Primary Key Constraint violation
When using Apex collections from time to time this unique constraint error happens.
ORA-00001: unique constraint (FLOWS_030000.WWV_FLOW_COLLECTIONS_UK) violated
Now, I can't figure out why this constraint would be happening as we check for the existence of a collection before trying to create one, and the constraint relies on a number of values which we can't modify.
All of our collection operations are done using the following APEX_COLLECTION calls
COLLECTION_MEMBER_COUNT
COLLECTION_EXISTS
CREATE_OR_TRUNCATE_COLLECTION
ADD_MEMBER
DELETE_MEMBERS
As I don't modify any data inside of the collections using any methods other than these above API calls I'm a bit confused.
It's almost impossible for me to reproduce the error as it happens very rarely, in addition, most of the time performing the same action again after the constraint error has happened will succeed.
Any ideas what I might be doing that could cause this?
Thanks in advance,
JoeI'm not sure if this will help but here's some more info:
1. The constraint being violated is not a primary key constraint but a unique constraint as defined by:alter table wwv_flow_collections$
add constraint wwv_flow_collections_uk
unique(session_id, user_id, flow_id, collection_name, security_group_id)
/2. The CREATE_OR_TRUNCATE_COLLECTION procedure first checks for the existence of a collection with those 5 keys. If found, it does: delete wwv_flow_collections$ where id = <the id of the existing collection>;This delete cascades to rows in wwv_flow_collection_members$.
Then, whether the "truncate" occurred or not it does this: insert into wwv_flow_collections$( collection_name ) values( upper(p_collection_name));3. The TRUNCATE_COLLECTION procedure requires that the named collection exists, fetches its ID and then:delete wwv_flow_collection_members$ m where m.collection_id = <the id of the existing collection>;4.Of the two scenarios Joe showed us, the first one creates the failure condition (assuming two concurrent sessions) by allowing an insert to be performed, i.e., the "create collection" action. Even if the first inserter takes a while to commit, the second one will wait on a lock until the first inserter commits, then it will attempt an insert and raise the UK violation. In the second scenario, nobody ever inserts; only deletes from collections_members$ are issued (assuming the create_collection procedure is never called).
Scott
P.S. My head hasn't hurt this bad since Vikas's background job puzzler (Re: Background jobs
Maybe you are looking for
-
Are Acrobat 7.0 Standard and Windows 8.1 compatible?
Trying to install Acrobat 7 from cd onto new pc windows 8.1 Gets to the point where it says installing acrobat but installation never progresses Retired and only really need to use it occasionally now so don't want to buy newer version if can be avoi
-
I use jdeveloper 11g and I want to create an unbounded LOV,so I declared a variable in Page Definition (this variable will be used as Base Data Source for LOV component) then I dropped an af:inputListOfValues from ADF Faces Common Components palette.
-
RSRT Peformace Button Issue.
Hi Friends, In RSRT transaction which is for query monitor, I select a query which belongs to an Infocube and press the performance info button. It has to display the performance information of that query, but it does not come up with anything. Can a
-
Question about System Properties?
Can anyone shed some light apon this, if i have my midlet running in the background i.e. display set to null.... can j2me read the state of the phone system? Can j2me read any 'system property' like active/idle/keylocked?? ..../fg
-
Does my macbook pro mid 2009 read SDHC cards in the card reader?
does my macbook pro mid 2009 read SDHC cards in the card reader?