[JBossCache] - Query cache using 1.4.1
by loumaus
hi there ..
we are running into a query cache problem and need help:
The log:
/sql: select /*+ USE_NL(c d cd) */ c.document_id, c.title, c.label, c.released, c.cover_jpg_mid, c.ftm_containertype_id, c.full_artists, c.product_id, c.genre_id, cd.usr_rating_avg from j_ftm_container c, (select row_number() over(order by part, pos nulls last) pos, part, document_id from (select min(part) part, min(pos) pos, document_id from (select * from (select 'a static' part, row_number() over(order by t.sort desc nulls last) pos, t.document_id from j_documenttree t where t.parent_id = (select id from j_documenttree where path = ? and name = ? and state_id = 2) and exists (select 1 from j_ftm_containerdetail d where d.country_id = ? and d.state_id = 2 and d.ftm_containertype_id in (?, ?, ?, ?, ?, ?) and d.ftm_container_document_id = t.document_id and d.released between ? and ?)) where pos <= ? union select * from (select 'b dynamic' part, row_number() over(order by d.released desc nulls last) pos, d.ftm_container_document_id from j_ftm_containerdetail d where d.country_id = ? and d.state_id = 2 and d.released between ? and ? and d.ftm_containertype_id in (?, ?, ?, ?, ?, ?)) where pos <= ?) group by document_id)) d, j_ftm_containerdetail cd where d.pos between ? and ? and d.document_id = c.document_id and c.document_id = cd.ftm_container_document_id; parameters: ; named parameters: {country_id=1, containertype_id3=3, pos_start=1, containertype_id6=6, containertype_id2=2, date_start=Thu Feb 01 00:00:00 CET 1900, containertype_id5=5, containertype_id1=1, pos_end=10, date_end=Thu Nov 22 23:59:59 CET 2007, containertype_id4=4, documenttree_path=root/full_length/catalog/Startpage, documenttree_name=Neuheiten}
item: [11957243932, 6721540, 6934684, 6540921, 6542774, 6713918, 6717515, 6714902, 6714040, 6873547, 6721517]
/sql: select /*+ USE_NL(c d cd) */ c.document_id, c.title, c.label, c.released, c.cover_jpg_mid, c.ftm_containertype_id, c.full_artists, c.product_id, c.genre_id, cd.usr_rating_avg from j_ftm_container c, (select row_number() over(order by part, pos nulls last) pos, part, document_id from (select min(part) part, min(pos) pos, document_id from (select * from (select 'a static' part, row_number() over(order by t.sort desc nulls last) pos, t.document_id from j_documenttree t where t.parent_id = (select id from j_documenttree where path = ? and name = ? and state_id = 2) and exists (select 1 from j_ftm_containerdetail d where d.country_id = ? and d.state_id = 2 and d.ftm_containertype_id in (?, ?, ?, ?, ?, ?) and d.ftm_container_document_id = t.document_id and d.released between ? and ?)) where pos <= ? union select * from (select 'b dynamic' part, row_number() over(order by d.released desc nulls last) pos, d.ftm_container_document_id from j_ftm_containerdetail d where d.country_id = ? and d.state_id = 2 and d.released between ? and ? and d.ftm_containertype_id in (?, ?, ?, ?, ?, ?)) where pos <= ?) group by document_id)) d, j_ftm_containerdetail cd where d.pos between ? and ? and d.document_id = c.document_id and c.document_id = cd.ftm_container_document_id; parameters: ; named parameters: {country_id=1, containertype_id3=3, pos_start=1, containertype_id6=6, containertype_id2=2, date_start=Thu Feb 01 00:00:00 CET 1900, containertype_id5=5, containertype_id1=1, pos_end=10, date_end=Thu Nov 22 23:59:59 CET 2007, containertype_id4=4, documenttree_path=root/full_length/catalog/Startpage, documenttree_name=Neuheiten}
item: [11957243790, 6721540, 6934684, 6540921, 6542774, 6713918, 6717515, 6714902, 6714040, 6873547, 6721517]
The two lines reveal that the queries are identically and use the same parameters.
The problem is that the query cache creates two entries which leads to two db queries instead of storing the first one and using it for the second call as well.
The only difference between both is the internal key (first entry at item ) under which each query is stored internally.
any idea ???
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107019#4107019
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107019
18 years, 8 months
[JBoss Seam] - Re: formattedText with dynamic content - escaping
by appendix
Hi Pete,
thank you for showing interest.
I gave the whole situation a brief thought and came to the conclusion that a generic approach that transparently escapes rich text tokens in s:formattedText would be hard to implement, because the method would have to differentiate somehow between formatting rich text tokens and tokens that are simply in the text as characters, so I'm using a pretty simple, but working, approach right now.
I'm having a Seam managed Java Bean called "ste" (short for seam text escaper), which offers a method "esc(String s)" that escapes the rich text tokens using a Stringtokenizer.
So in the message bundle I can escape certain properties, that could contain rich text tokens which needs to be escaped like that:
| newGroupCreated.text=The new group '*#{ste.esc(group.name)} (#{ste.esc(group.nameShort)})*' was created successfully.
|
Now 'newGroupCreatet.text' can be used in <s:formattedText /> even if 'group.name' contains characters like underscore or slash without breaking the generated HTML.
If anyone is interested, I can post the code as well, but it's nothing spectacular.
Best regards,
Kurt
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107009#4107009
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107009
18 years, 8 months