Suitable Caching Mechanism
Apoplogies if this is the wrong newsgroup. My J2EE App runs on Weblogic 8.1 and uses Oracle 9. It involves processing at times up to 50000 database records at a go. The Application applies an algorithm to each database record and then writes it's results to an output table which has a one to one mapping with the input table i.e I will be inserting about 50000 records. In order to improve performance I want to use JDBC batch inserts, however each output record is produced by a MDB (Message Driven Bean) from a pool.I guess I need a sort of cacheing mechanism which holds the records from the MDBs and some business logic to apply the JDBC batch insert to a chunk of the cache. I will probably need a timed event to perform this "flushing" of the cache periodically. Anybody have experience of doing something similar or able to provide a more elegant solution to the problem?
TIA
Hi Sailendra,
In this case you can make use of BPM object if I understood your question correctly.
In the component Cataloge make a BPM object and under that create attribute/attributes/array. Then the value you want to save/store keep it in a bpm object attribue and pass the bpm object from one process layer to another/as per your requirement. ex: bpmobject.attribute1Name = "Bibhu";
You can acccess those values in another process/activities by bpmobject.attributeName
bpmobject is the object that you created and the instance variable is of type created bpmobject.
attributeName is the attribute where you stored the value.
Regards
Bibhu
Similar Messages
-
== Issue
==
I have a problem with my bookmarks, cookies, history or settings
== Description
==
Hi,
I developed a web application using HTML5-Offline Application Cache mechanism. Inspite of deleting the cache as mentioned in the above steps, Firefox still maintains a copy of the page in it's cache. Also, a serious bug is, even though we delete all temp files used by Firefox, and open the previously cached page, it displays it correctly, but upon refreshing/reloading it again shows the previous version of the page maintained in the cache.
== Troubleshooting information
==
HTML5: Application Caching
.style1 {
font-family: Consolas;
font-size: small;
text-align: left;
margin-left: 80px;
function onCacheChecking(e)
printOutput("CHECKINGContents of the manifest are being checked.", 0);
function onCacheCached(e) {
printOutput("CACHEDAll the resources mentioned in the manifest have been downloaded", 0);
function onCacheNoUpdate(e)
printOutput("NOUPDATEManifest file has not been changed. No updates took place.", 0);
function onCacheUpdateReady(e)
printOutput("UPDATEREADYChanges have been made to manifest file, and were downloaded.", 0);
function onCacheError(e) {
printOutput("ERRORAn error occured while trying to process manifest file.", 0);
function onCacheObselete(e)
printOutput("OBSOLETEEither the manifest file has been deleted or renamed at the source", 0);
function onCacheDownloading(e) {
printOutput("DOWNLOADINGDownloading resources into local cache.", 0);
function onCacheProgress(e) {
printOutput("PROGRESSDownload in process.", 0);
function printOutput(statusMessages, howToTell)
* Outputs information about an event with its description
* @param statusMessages The message string to be displayed that describes the event
* @param howToTell Specifies if the output is to be written onto document(0) or alert(1) or both(2)
try {
if (howToTell == 2) {
document.getElementById("stat").innerHTML += statusMessages;
window.alert(statusMessages);
else if (howToTell == 0) {
document.getElementById("stat").innerHTML += statusMessages;
else if (howToTell == 1) {
window.alert(statusMessages);
catch (IOExceptionOutput) {
window.alert(IOExceptionOutput);
function initiateCaching()
var ONLY_DOC = 0;
var ONLY_ALERT = 1;
var BOTH_DOC_ALERT = 2;
try
if (window.applicationCache)
var appcache = window.applicationCache;
printOutput("BROWSER COMPATIBILITYSUCCESS!! AppCache works on this browser.", 0);
appcache.addEventListener('checking', onCacheChecking, false);
appcache.addEventListener('cached', onCacheCached, false);
appcache.addEventListener('noupdate', onCacheNoUpdate, false);
appcache.addEventListener('downloading', onCacheDownloading, false);
appcache.addEventListener('progress', onCacheProgress, false);
appcache.addEventListener('updateready', onCacheUpdateReady, false);
appcache.addEventListener('error', onCacheError, false);
appcache.addEventListener('obsolete', onCacheObselete, false);
else
document.getElementById("stat").innerHTML = "Failure! I cant work.";
catch (UnknownError)
window.alert('Internet Explorer does not support Application Caching yet.\nPlease run me on Safari or Firefox browsers\n\n');
stat.innerHTML = "Failure! I cant work.";
== Firefox version
==
3.6.3
== Operating system
==
Windows XP
== User Agent
==
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729; .NET4.0E)
== Plugins installed
==
*-Shockwave Flash 10.0 r45
*Default Plug-in
*Adobe PDF Plug-In For Firefox and Netscape "9.3.2"
*NPRuntime Script Plug-in Library for Java(TM) Deploy
*The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
*Google Update
*4.0.50524.0
*Office Live Update v1.4
*NPWLPG
*Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
*Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
*Npdsplay dll
*DRM Store Netscape Plugin
*DRM Netscape Network Object
Thanks & Regards,
Kandarpa Chandrasekhar Omkar
Software Engineer
Wipro Technologies
Bangalore.
[email protected]
[email protected]We have had this issue many, many times before including on the latest 3.6 rev. It appears that when the applicationCache has an update triggered by a new manifest file, the browser may still use only its local network cache to check for updates to the files in the manifest, instead of forcing an HTTP request and revalidating both the browser cache and the applicationCache versions of the cached file (seems there is more than one). I have to assume this is a browser bug, as one should not have to frig with server Cache-Control headers and such to get this to work as expected (and even then it still doesn't sometimes).
The only thing that seems to fix the problem is setting network.http.use-cache to false (default is true) in about:config . This helps my case because we only ever run offline (applicationCache driven) apps in the affected browser (our managed mobile apps platform), but it will otherwise slow down your browser experience considerably. -
Hello all
i have application that basically loading very big object that contains sub objects and
doing dynamic lookup by name of the object and the method i like to invoke and then invoke it
everything done ofcorce with reflection .
now this application will be called handeret times per minute .
some questions .
first of all do i need caching mechanism? for saving the subobject that had bean called in some kind of vector in memory for example or if i use reflection , i dont need caching mechanism .
second question is do i need threads here ? if i do , how i buid some kind of locks to this threads ?
thanksI'd use the Flyweight pattern here. It sounds like you're retrieving a lot of data that's related to other data through some kind of index. A Data Transfer Object (DTO) is a Flyweight class that could hold all of the information required to retrieve the "sub-objects" as you call them, but not until they're needed. It's a little more detailed to make sure that the objects are available when you need them, but obviously the network bandwidth/latency issues are causing a severe performance impact. I'm using EJBs in this example, but it will apply to anything where large amounts of related data are used in the application.
// EJB Entity bean
public abstract class EJBEntity extends EJBObject {
public abstract Integer getId();
public abstract String getStringData();
public abstract Collection getChildObjects(); // "heavyweight" data
// Data Transfer Object
public class EJBEntityDTO {
private int id;
private String stringData;
private int[] childIds;
// some application code
id = ...
EJBEntityDTO dto = transferEJBData(id);
EJBEntityDTO childDTO = transferEJBData(dto.childIds[0]);
...It's definitely more work to do it this way, but it's the only way to avoid fetching the entire collection when you only need one child object.
Brian -
I just need to know how firefox handles/takes care of/and does its work with cookies and cache, basically its caching mechanism. Also comparing it to IE versions 6/7 and 8/9 would help, for the sake of web development with respect to the two browsers (Detailed technical answer would help). Since web apps may sometimes work on firefox and sometimes not while it works in IE just fine.
Hi Kellymarr,
You can take a look at the release notes for each version to see what has been added or fixed:
http://www.mozilla.org/en-US/firefox/4.0/releasenotes/
Just change the version number in the url to see each major release.
Hopefully this helps! -
I want to know the caching mechanism of Firefox
Hi everyone,
i want to know how exactly caching mechanism works in firefox? I know for the cached objects we have two info
Expire date or Max-age, how we use them while deciding if the object should be served from cache or notYou neither described the problem you actually had nor the version you had. There may be other solutions such as described in the following answer which also tells you how to go back to to any version
https://support.mozilla.com/questions/840344
You can make Firefox 4.0.1 and '''Firefox 5.0''' look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)] -
Hi,
We are building an application using stateless session beans to access some
back end systems. The backend transaction is rather expensive with regards
to execute time. To optimize response times we are looking at a caching
strategy, we have identfied the following implementation alternatives :
1. Create object cache implementations as statefull session beans, storing a
reference to them in JNDI.
2. Create object cache implementations as regular java objects and storing
the entire object in JNDI.
Which one of these alternatives we choose will rely on the performance of
the WL JNDI, we are using the 5.1 server. If WL JNDI is capable of handling
reasonable amounts of data there should be no reason to use the expensive
statefull session beans.
Q1 : Are there any method to calculate the amount and troughput of data that
would be possible using alternative 2 ?
Q2 : Are there any other mechanism we should consider ?
Any help would be greatly appreciated
Regards,
Anders MathisenRead-Only entity beans are the entity beans which never call ejbStore() and
ejbLoad() is only called when timeout is expired (or never).
If you want to cache data for the session only you can use HttpSession - in
the cluster all requests are pinned to the server which originated the session
until this server fails. To minimize replication overhead you can use transient
fields or use the fact that replication happens only when session attribute is
set() - you can associate a cache object with the session and lazy populate it
later.
Anders Mathisen <[email protected]> wrote:
hi,
thanks for the response, what do you mean by read-only entity beans ?
Beans that are loaded with data manually (from eg. a stateless session
bean), and just used as a dataholder ?
I forgot to mention in the previous article that the caching mechanism here
needs only be local to a single users session. That is a session will never
use cached data from another session.
Althoug even if we have the requirement above, some caching mechanism
allowing for sharing of data could be handy here, this is not an absolute
requirement.
Anders M.
Rob Woollen <[email protected]> skrev i
meldingsnyheter:[email protected]...
Stateful session beans should not normally be used as a cache. A
stateful session bean instance is associated with a single user.
I wouldn't use JNDI as a caching mechanism either.
My suggestion would be Read-Only entity beans.
-- Rob
Anders Mathisen wrote:
Hi,
We are building an application using stateless session beans to access
some
back end systems. The backend transaction is rather expensive withregards
to execute time. To optimize response times we are looking at a caching
strategy, we have identfied the following implementation alternatives :
1. Create object cache implementations as statefull session beans,storing a
reference to them in JNDI.
2. Create object cache implementations as regular java objects andstoring
the entire object in JNDI.
Which one of these alternatives we choose will rely on the performanceof
the WL JNDI, we are using the 5.1 server. If WL JNDI is capable ofhandling
reasonable amounts of data there should be no reason to use theexpensive
statefull session beans.
Q1 : Are there any method to calculate the amount and troughput of datathat
would be possible using alternative 2 ?
Q2 : Are there any other mechanism we should consider ?
Any help would be greatly appreciated
Regards,
Anders Mathisen--
Coming Soon: Building J2EE Applications & BEA WebLogic Server
by Michael Girdley, Rob Woollen, and Sandra Emerson
http://learnweblogic.com
Dimitri -
Are there internal caching mechanism
I recognized in my tests, that the response time of the IMDB Cache getting faster after serveral execution of the same SQL Command.
Are there internal request caching mechanism? What ist the name of these functions?The TimesTen database maintains a cache of prepared SQL statements which is known as the command cache. Whenever a statement is prepared we first check to see if the statement already exists in the cache and if so we will use the existing cached plan rather than do a full prepare. This is similar to soft versus hard parse in the Oracle database.
There are some builtin procedures that allow you to examine the contents of this cache; look in the TimesTen Database reference guide at the builtins that start with ttSQLCmd...
Chris -
Hello All,
We have implemented a caching mechanism using UET table. It is working fine whenever database tables get updated.
My Question is:
If we are viewing a report on the Dashboard at the same if the database tables get updated, Is it compulsion to press the Refresh button on the Dashboard to reflect the changes?
We are thinking that if we traverse other tabs or other dashboards and coming back to the report which we are viewing will reflect the changes because now it will issue the SQL to the database rather getting the data from Cache as it is purged by cache mechanism.
Is our assumption is wrong because we unable to see the updated data?
-VencyHi mma,
As you suggested, we have checked 'Bypass Oracle BI Presentation Services Cache' and any changes to database reflecting on to dashboards without pressing refresh button.
But, doing so , BI Presentation Server issuing SQL everytime rather selecting it from Cache, as we disable it. So, it is taking time everytime viewing the Reports on the Dashboard.
Do we have any mechanism to purge the Presentation Services Cache manually like we do for BI Server cache at the time of updating database tables?
Thanks,
-Vency -
HI ,
Does OBPM have any caching mechanism(build in API) to store data .I have some data to be used in one of the process.I can't not connect to the external DB because my OBPM don't have a direct connection to external DB.Only way is queue.Every Time I can't post request in queue to get this data.
Please help me
Thanks
SailendraHi Sailendra,
In this case you can make use of BPM object if I understood your question correctly.
In the component Cataloge make a BPM object and under that create attribute/attributes/array. Then the value you want to save/store keep it in a bpm object attribue and pass the bpm object from one process layer to another/as per your requirement. ex: bpmobject.attribute1Name = "Bibhu";
You can acccess those values in another process/activities by bpmobject.attributeName
bpmobject is the object that you created and the instance variable is of type created bpmobject.
attributeName is the attribute where you stored the value.
Regards
Bibhu -
Decument about buffer cache mechanism
hi gurus
I want some documentations about the buffer cache internal mechanism,for example the internal structure of the buffer cache,how does the buffer cache works and the LRU mechanism.The more detailed the better.
I have searched on Oracle Documentation Linrary with buffer head or buffer descriptor as keywords.I did not get what i want.
many thanks in advance.Hi Kevin,
I believe information which you are looking is not published by Oracle and is avaialable only to Oracle Support and other employees. You can refer to Note:62172.1 for buffer cache mechanism. It mentioned about a note with "@" in beginning meaning the remark was supposed to be unpublished.
"@ See Note 104937.1 for a description "
May be the above note has got some description. Anyways I will suggest you to go through the Note:62172.1 and get basic understanding which should be sufficient for dba's.
Cheers
Amit -
Standard Servlet caching mechanism
Gurus,
Is there any standards on caching servlet reponse. Most of the application servers provide their own mechanism to cache servlet response.
I am looking for application server netural standards for caching servlet resposne. If there is no standards for caching available in any of the servlet > 2 releases, probably i would send an email to servlet specification guys to think on something like this.
Its lot of pain when you write code in some server and deploy it on some other server where the servlet caching response caching is suported.
Any help in this will be appreciatedHere is more explanation...
Suppose for an example, a servlet that accepts parameter(s) and queries the database and displays a html text, may be around 100 records. ok?
Next time when you make the same request with same set of parameters, the servlet excecutes the db query again and display the same result when it was intially called.
Now my question, is there standard mechanism to cache the servlet reponse at server side and when the request is made with same set of parameters, it would be served from the cache instead of making db call.
In addition to that, it should work under all the application server when you deploy
Let me know if this clear enough, or i can add more stuff in here. -
How the caching mechanism in firefox 3.6 compares to IE 6/7 and IE 8/9
''duplicate of https://support.mozilla.com/en-US/questions/902406''
Sometimes when running web apps it will not work properly on Firefox compared to IE. I tried to look all over the internet for how Firefox handles its cookies and cache (technical) but its non existent. All that comes up is how to delete cache, but as a web app developer knowing how it does these things would be extremely helpful. What are the difference between Firefox 3.6 and IE versions 6/7 and 8/9 that may make it not work?
ThanksFirst of all, if you haven't applied the two RH patches, I recommend you do as one is critical.
The cursor to change the width of the TOC is working fine for me in FF. Have you rebooted since spotting the problem?
I doubt it is project related but also try more than one project.
See www.grainge.org for RoboHelp and Authoring tips
@petergrainge -
Regarding caching mechanism - Pls respond ASAP.
Hi All,
I am trying to apply "purging of cache" on daily basis in my application because it is on transactional database. How could i proceed. I think if i am adding a event polling table and set the frequncy to 1 day then i can achieve that. But is there is any other way to do that automatically because i don't have scope to add another table in the database.
I have change the cache expiry of all physical table as 1 day. Is that will purge the cache every day or i need the event polling table.
Advance thanks on any suggestions.
Thanks
AshokThanks John.
But we have migrated the system in production environemet. Thats why we can't run the script there everyday because no one has permission to access the server.
For this we have to explicitly take access and run the script. That is not possible as far as i see the production setup.
Is there any way to automate this.
Thanks
Ashok -
Query for a simple caching mechanism
Suppose that I have a CONTRACT table with 50000 records.
I want to get the last inserted 100 records and then the next 100 and so on...
In other words, like using a file pointer I want to get the next n records and then the next n records... Because I cannot load all the records in memory.
I wrote a query with an IN clause and ROWNUM pseudo-column for the issue. But it doesn't result like i expected. Here is what it looks like:
SELECT contract.contract_id
FROM vw_contract contract
WHERE ROWNUM <= 2
AND contract.contract_date BETWEEN TO_DATE('03.01.2005','DD.MM.YYYY') AND TO_DATE('04.02.2005','DD.MM.YYYY')
AND contract.contract_id NOT IN (SELECT k.contract_id
FROM vv_yk_dp_contract c
WHERE ROWNUM <= 2
AND c.contract_date BETWEEN TO_DATE('03.01.2005','DD.MM.YYYY') AND TO_DATE('04.02.2005','DD.MM.YYYY'));
To test it, I select the first 4 records. That query should give me the third and forth records but it doesn't. Also, the query is slow.
Should I use a cursor? But, with PL/SQL how can a cursor be used for getting records between Nth and Mth?
What kind of strategy should be used for such a simple caching issue?I want to get the last inserted 100 records and then the next 100 and so on...
In other words, like using a file pointer I want to get the next n records and then >>the next n records...Something like this ? (But the solution depends on what kind of client you use).
SQL> create or replace type t_varchar is table of varchar2(10)
2 /
Type created.
SQL> create or replace package pkg1
2 is
3 cursor a is select ename from emp order by 1;
4 end;
5 /
Package created.
SQL> create or replace function get_rows
2 return t_varchar
3 pipelined
4 is
5 name emp.ename%type;
6 begin
7 if not pkg1.a%isopen then
8 open pkg1.a;
9 end if;
10 loop
11 fetch pkg1.a into name;
12 exit when pkg1.a%notfound;
13 pipe row(name);
14 end loop;
15 close pkg1.a;
16 return;
17 end;
18 /
Function created.
SQL> select /* from 1 to 3th */ * from table(get_rows) where rownum <=3;
COLUMN_VAL
ADAMS
ALLEN
BLAKE
SQL> select /* from 4th to 9th */ * from table(get_rows) where rownum <= 6;
COLUMN_VAL
CLARK
FORD
JAMES
JONES
KING
MARTIN
6 rows selected.
SQL> select /* from 10th to 14th */ * from table(get_rows) where rownum <= 5;
COLUMN_VAL
MILLER
SCOTT
SMITH
TURNER
WARDRgds. -
Concurrent Access to Cache Mechanism
Below I have code from an object that is used for caching data from a database. My question deals with the method getCacheObj(). Does getCacheObj() return a copy of the reference to cacheObj or does it return the actual cacheObj variable itself?
Specifically I am concerned about a concurrency issue when the methods refreshCache() and getCacheObj() are called simultaneously. What would happen in the following situation:
Thread 1 calls findActiveByWebsiteArea() which calls getCacheObj(). getCacheObj() returns the cacheObj for processing down the line in a jsp or other java object. Prior to thread 1 finishing the processing with cacheObj, thread 2 calls refreshCache() which resets cacheObj. Is it possible for thread 2 to clash with thread 1?
public class NewsPeer extends AncestorCachePeer {
// object that will house the cached data
protected static NewsPeer cacheObj = null;
// attributes for the instantiated cache object
private Hashtable newsByWebsiteArea = null;
private NewsPeer() {
// private constructor to enforce a singleton
public static void refreshCache() throws Exception {
// reset the cache object so a fresh retrieve will be performed
// the next time the cache is accessed
synchronized (cacheObj) {
cacheObj = null;
private static NewsPeer getCacheObj() throws Exception {
synchronized (cacheObj) {
if (cacheObj == null) {
cacheObj = new NewsPeer();
cacheObj.retrieveCache();
return cacheObj;
public static List findActiveByWebsiteArea(String websiteareaId) throws Exception{
// get item from cache obj
return (List) getCacheObj().newsByWebsiteArea.get(websiteareaId);
private void retrieveCache() throws Exception {
// code to populate newsByWebsiteArea on cacheObj
}I feel it's not a good idea to make your lock object null somewhere ...
for example, let us say refreshCache() method acquired the lock.
but before it performs CacheObj = null, it gets descheduled, and another thread, runs getCacheObj() and since it
cannot get the cacheObj, it waits on cacheObj's queue, and now the previous thread resumes, which makes cacheObj null.
It will be better if you can have a separate lockObject.
This is my suggestions and I may be wrong. So let us wait for the experts to give some more suggestions..
Maybe you are looking for
-
Install Windows 8 on 13" late-2011 macbook pro (incompatible?)
I'm trying to install Windows 8 on my Macbook Pro 13" i7 (late-2011) using bootcamp. I've got Mountain Lion 10.8.3, which I assume means Boot Camp 5. According to this article (http://support.apple.com/kb/HT5634?viewlocale=en_US), my computer should
-
Migrations assistant won't transfer apps
I just finished using migration assistant to transfer everything from my old computer to my new macbook pro 15 over firewire. When it finished none of my apps had transfered. They show up in finder but when you click on the application it says "You c
-
8703e blackberry email copy to blackberry storm
I have a Blackberry 8703e. I just purchased a blackberry storm. I have many emails on the old unit that I need on the new unit. How do I copy over the old messages. Some of the old messages are not on my local outlook on my computer. Please advi
-
3-12-07 Downloaded fink 0.7.2 (for 10.3.x!) from fink's homepage. Installer stops because it can't install on my eMac HD since "the volume doesn't support symlinks". ANYONE GOT A CLUE? eMac G4 (build 7W98) 125 GHz, 256 MB, 37 GB Mac OS X (10.3.9)
-
hey guys so i've got a GUI (as a JSP file) going where i've got it to display the map of a certain county in the US with a few features like pan zoom in enabling/disabling the themes using the Oracle MapViewer API. But now what if i want to be able t