Caching reference to home

I want to cache JNDI Look ups for EJBs.
I will do a look up for the EJBs at class loading and then cache them in the memory.
This will only be done on
the server side i.e both the client and EJBs are on server side (so securing JNDI
look up is not of any concern). Will clustering of
server (same of different machine) have a effect on this caching mechanism. As
JNDI service corresponds
to a server instance. I am on WL 5.1 with service pack 8
Also is there a way where I can do a lookup of multiple EJBs in a single lookup
call. May be like giving
a list of beans to be looked up as parameter. Using common intial context (reference
to JNDI tree), I want to
achieve this lookup in a single call. All this will be done statically (during
class loading) and cached in memory.
Thanks
Mohit

1. With WL, no problem config'ing and caching as you specified
2. No way to multi lookup
Peace,
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
+1.617.623.5782
WebLogic Consulting Available
"M Segi" <[email protected]> wrote in message
news:3af6b66d$[email protected]..
>
I want to cache JNDI Look ups for EJBs.
I will do a look up for the EJBs at class loading and then cache them inthe memory.
This will only be done on
the server side i.e both the client and EJBs are on server side (sosecuring JNDI
look up is not of any concern). Will clustering of
server (same of different machine) have a effect on this cachingmechanism. As
JNDI service corresponds
to a server instance. I am on WL 5.1 with service pack 8
Also is there a way where I can do a lookup of multiple EJBs in a singlelookup
call. May be like giving
a list of beans to be looked up as parameter. Using common intial context(reference
to JNDI tree), I want to
achieve this lookup in a single call. All this will be done statically(during
class loading) and cached in memory.
Thanks
Mohit

Similar Messages

  • Cache.db in home folder, should this be here?

    I just did a restore from my time machine back up, and now there is a Cache.db file in my home folder.
    Can I just delete it?  Or should I just make it hidden?

    Hi Brian, I had the exact same "issue" yesterday, and as I don't like erroneous files populating my hdd I decided to deal with it!
    As most if not all caches can be cleared I figured it could be deleted, so I did, but only after copying it over to a flash dive.  Better safe than sorry
    All seems to be working fine without it though...

  • Caching EJB references

    Hi all,
    I was wondering if anyone could give me a conclusive explanation regarding the caching options for EJB objects(SLSB, and Entity Beans), both home/remote and localHome/local.
    I have read a lot of various EJB documentations including a fairly thorough look into the spec, and have about 2 years of practical expirience with EJBs.
    The matter that is still vague to me after all this time is the matter of caching and reusing EJB references. practical expirience and some documentation lead me to believe that caching an EJB reference of any kind is hazardous. From what I saw the spec never adresses this issue in a straightforward conclusive manner. It does discuss some failover scenarios and the use of EJB handles as both optionally a persistent reference and a "long living" refernce, but never in a context that is "spec mandatory" and "encapsulates" the whole picture.
    Now, there is no fundamental difference between caching a reference or using one that is locally scoped in a single method, except the time it is expected to be "alive", which is, by definition, a relative and unmeasurable matter.
    Theoretically, I am sure there is no problem implementing references, which are actually client "proxies", stubs, in a way that will not be dependent of an exact instance, but rather on an abstract EJB ID(which may indeed cause a performance overhead).
    Anyway, I don't want to get into implementation details, I am simply looking for a clear explanation about the matter of "long living" references, and what is mandatory by EJB specification.
    Thanks for any insights....
    I also crossposted to EJB forum -> http://forum.java.sun.com/thread.jsp?forum=13&thread=538526&tstart=0&trange=15

    A locally scoped reference is only on the stack while the cached reference is on the heapOf course, but in the context of what I'm talking about here, that doesn't really matter. The point is that in both cases there is a reference to an EJB object/home, that is used for a longer/shorter time.
    I think the main reason for not caching the references is that is interfere's with the server's ability to manage it's resources. OK, sounds reasonable enough. So why doesn't the specification provide clear rules, even restrective ones that say no caching can be applied? Looks to me as if it would be safe to say that home objects for example are safe to cache working with any EJB server as long as the EJB server isn't restarted. Why isn't it written anywhere?
    It always refers to Handles as "long living" references. How can one measure "long"?
    Now, I may have gotten the wrong picture. Maybe there are some widely agreed issues on this matter, for example that caching SLSB as you've mentioned, and home objects is always safe in the scope of an EJB server life time(from the point in which it starts to the point it goes down).
    The thing is, where ever I looked I saw different strategies, and never it was clear what exactly they came to solve. For instance, an EJBHome service locator that caches the home object as is, vs. a service locator that caches the home handle.

  • Why can't local references be cached ?

    Hi,
    I read that the local references created during the lifetime of a native method cannot be cached and used in another lifetime of the native method. I don't understand why they can't be cached. I know that the VM creates a registry of local references, which is deleted once the lifetime of a native method is over, thereby allowing the objects referred by those local references be eligible for garbage collection. But then if a local reference is cached to some global/static variable, then the object referenced cannot be GCed. Hence we should be able to use that cached reference in a later execution of the native method too. i.e., Even though the local reference of the eariler exceution was freed, since we have cached its value (which I assume is a sort of pointer to the actual object), we should be able to use the cached reference. If not, can anyone please explain why this does not work like that ?
    Thanks.

    I don't want global reference. But I just wanted to understand why local references can't be cached. Though I had read what all you said above, before posting my question, the answer somehow occurred to me while I was reading your reply. So, thanks.
    I think the cruical point here is that, the JVM is not aware of the copies of the local references. It does not know and care how many copies of local references we (JNI programmers) make at the JNI level.

  • Losing Cached Objects

    I'm having a problem with losing Cached references to JNDI Objects(Home Interfaces,
    JMS Connection Factories, Data Sources, etc.).
    I have singleton(Let's call it Cache) that stores the cached objects.
    A client calls Cache.lookup passing in the JNDI name.
    If the object isn't cached then the Cache looks it up via the JNDI context, otherwise
    it returns the cached reference.
    My problem is that once it returns the cached version, the client receives a null
    object.
    Can anyone help?
    - Anuj

    It sounds to me as if your cache isn't working and its not really related to
    JNDI?
    After the first call, the cahce should be storing the object and not using
    JNDI any more, right?
    Have you tried stepping through your cache code with a debugger?
    "Anuj Mehta" <[email protected]> wrote in message
    news:[email protected]..
    >
    I'm having a problem with losing Cached references to JNDI Objects(HomeInterfaces,
    JMS Connection Factories, Data Sources, etc.).
    I have singleton(Let's call it Cache) that stores the cached objects.
    A client calls Cache.lookup passing in the JNDI name.
    If the object isn't cached then the Cache looks it up via the JNDIcontext, otherwise
    it returns the cached reference.
    My problem is that once it returns the cached version, the client receivesa null
    object.
    Can anyone help?
    - Anuj

  • Working on two machines - what about the media cache ?

    I'm a long time user of FCP just getting my head around Premiere Pro CS5.5. I quite often work on the same project at work and at home. With FCP I simply duplicated the media onto another drive and just transported the project file on a flash disk - obviously rendering of effects would have to be done locally.
    Now with Premiere I notice there's the media cache which, as far as I can tell, is not necessarily anything to do with rendering and effects but related and applied to every clip.
    So my question is, will the media cache have to be built from scratch on each machine every time I move the project file ?
    If so, is there a way to avoid this so that I wont have to wait for it to build the media cache ?
    ....or on a 30 minute film with 15 hours of original media will this will this be a quick process so as not to be a problem ?
    I suppose what I'm really asking is how can I easily work on the same project in different locations ?
    Any help appreciated.

    At the moment my media cache is in my user library folder on the system drive.
    I would avoid using the system drive for media cache files.
    The best would be to have a separate, identically named drive
    (D for example) for your media cache.
    If you use an external drive for your media, make sure that
    you assign the same drive letter to this drive on both systems.
    ... and then duplicate the lot onto another drive ?
    I have never tried to wholesale copy media cache files from one
    system to another... preferring to allow Premiere to generate a
    cache for each system.
    One other thing. Suppose I capture some more media at work, can I just copy this media into the same location on my home drive and then will the media cache on my home machine just update the new media ?
    Yes.
    A good reference for disk setup can be found here:
    Generic Guideline for Disk Setup

  • Can l make an instance of EJB home handler / Datasource shared by EJB objs

    all ejb guru
    As far as l know, it is general rule of thumb to cache the EJB home handlers and datasource object at EJB bean instance. But can l go a step further, make the same instance of EJB home handlers and datasource object shared by more than 1 EJB bean instance ?
    ( l checked out the methods of javax.ejb.EJBhome and javax.sql.DataSource. They are not declared as synchronized. It seems to me that EJB home handlers and datasource object are not thread safe and not suitable for being shared. Even they are thread-safe, if they are shared by 1+ EJB bean instance. Sharing EJB home handlers and datasource object may interfere the thread management of EJB container. Am l correct ? )
    It is highly appreciated someone can share with me your insight in this issue.
    thanks & regards
    Danny

    Okay, you got me there. However, it's usually a better practice to start a new thread with your specific question instead of resurrecting old threads that (obviously) nobody cared enough to answer.
    DataSources are retrieved from the container via JNDI. You may (generally) cache them in order to alleviate the JNDI lookup without worrying about Threads, as there is only (usually) one DataSource object per server (or node in a cluster). Do not cache (in your code) the Connection objects obtained from the DataSource - always close them in order to return them to the pool maintained by the DataSource.
    Caching EJB HomeHandles is the accepted manner of avoiding repeated JNDI calls to locate EJBs. Typically, extracting the EJBHome from the HomeHandle re-initializes whatever network operations are embedded in the EJBHome object(s) by the vendor's implementation. Once again, you do not necessarily need to worry about Threads - the container and vendor implementation is already taking care of that for you, transparently.
    Think about it: if there were Threading issues, even retrieving the above objects via JNDI would ensure that J2EE application servers wouldn't be Thread safe and all operations would be, essentially, blocked each time. Obviously, this is not the case since both DataSources and EJBHome objects can have multiple clients using them simultaneously. Just because there's not explicit synchronized tag on any of the methods defined in these interfaces doesn't mean they're single-Thread objects.

  • Bookmarks bar and home page problem in Safari 8.02

    Safari 8.0.2 is driving me mad with it’s apparent differences from previous versions. Principally, I no longer have a bookmarks bar and cannot set a home page. So, off I went to the Apple support site at http://www.apple.com/support/mac-apps/safari/ and was amazed to find no reference to 8.02? It all seems to be about Safari 7. (How I wish I could actually go back to that version)
    Am I just not seeing something obvious past the frustration of continually finding that so many tasks which used to be so easy in previous OS versions, seem to be so confusing in Yosemite? I am currently running Safari 8.02 installed and updated courtesy of the, (for me at least) disastrous Yosemite 10.10.1.
    It really gets my back up to think that Apple forces users to depend on the goodwill of the volunteers on this forum to solve problems with their OS. Clearly, they don’t make enough money to provide the resources to keep their own support pages up to date!
    Sorry all, end of rant, but If anybody knows how to get the bookmarks bar back and get the home page preference setting to actually work, can you please help me?
    John

    Hello Linc,
    Thanks for your speedy reply. I knew it would be something embarrassingly simple. (although I have to say I was looking for bookmarks, not favourites) Anyway, thank you.
    Reference the home page, I am going to preferences/general, with my desired home page as the current one and clicking on set to current page option but whenever I restart Safari, it opens with whatever page was current when I last quit Safari. I have also tried typing the desired homepage in that homepage box but it still seems to have a mind of its own. (I have put a home page icon on the menu bar at the top, next to the url which works fine but I never had to do this before, the homepage setting in general preferences used to work just fine)
    regards,
    John

  • Clear iPad Cache of Shared Library

    Does anyone know how to clear the cache of iTunes Home Sharing on the iPad? I'm making changes to the sorting of my shared TV Shows and I cannot get the ipad to show my changes. The only way I can figure out is if I restore the device and then connect to home sharing. I've tried restarting the device, the pc, clearing cache content from itunes folder... No luck. Any ideas? Shouldn't iTunes have a clear cache button that tells the devices to re-download all the info about the files?

    I just got off a 40min chat with Apple support and they fixed it.  So try the following if you are having the same issues:
    1. Close down the Videos app in your ipad
    2. go to ipad Settings / Videos, select Home Sharing email and signout
    3. go to shared library (mine was on my mac) and close down itunes completely then reopen
    4. go to ipad Settings / Videos and sign into Home Sharing
    After I did this and reopened the Video app the shared libraries where all in order.

  • Result cache invalidated

    Hi,
    Oracle version 11.2.0.1 on Linux
    I understand thatt result cache (RC) invalidation is at table level.
    I did a simple test:
    create table customer (custno number, custname varchar2(30));
    Table created.
    insert into customer (custno,custname) values (1,'Customer_1');
    insert INTO CUSTOMER (custno,custname) values (2,'Customer_X');
    select * from customer;
        CUSTNO CUSTNAME
             1 Customer_1
             2 Customer_X
    commit;
    Commit complete.Now I invoke result cache here
    select /*+ RESULT_CACHE */ * FROM customer where custno=1;
    Execution Plan
    Plan hash value: 2844954298
    | Id  | Operation          | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |                            |     1 |    30 |     3   (0)| 00:00:01 |
    |   1 |  RESULT CACHE      | ggb2vz6jcvcn5ajzqh406j3n85 |       |       |            |          |
    |*  2 |   TABLE ACCESS FULL| CUSTOMER                   |     1 |    30 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter("CUSTNO"=1)
    Result Cache Information (identified by operation id):
       1 - column-count=2; dependencies=(SCRATCHPAD.CUSTOMER); name="select /*+ RESULT_CACHE */ * FROM customer where custno=1"Invoke RC for second row query
    select /*+ RESULT_CACHE */ * FROM customer where custno=2;
    Execution Plan
    Plan hash value: 2844954298
    | Id  | Operation          | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |                            |     1 |    30 |     3   (0)| 00:00:01 |
    |   1 |  RESULT CACHE      | fc8t6svvz6whh0gc8vcaxrh668 |       |       |            |          |
    |*  2 |   TABLE ACCESS FULL| CUSTOMER                   |     1 |    30 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter("CUSTNO"=2)
    Result Cache Information (identified by operation id):
       1 - column-count=2; dependencies=(SCRATCHPAD.CUSTOMER); name="select /*+ RESULT_CACHE */ * FROM customer where custno=2"OK they are stored as separate result cache
    Now update the second row in that table in another session
    update customer set custname ='Customer_2' where custno=2;
    1 row updated.
    commit;
    Commit complete.Now query custno=2 from the first session
    select /*+ RESULT_CACHE */ * FROM customer where custno=2;
    Execution Plan
    Plan hash value: 2844954298
    | Id  | Operation          | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |                            |     1 |    30 |     3   (0)| 00:00:01 |
    |   1 |  RESULT CACHE      | fc8t6svvz6whh0gc8vcaxrh668 |       |       |            |          |
    |*  2 |   TABLE ACCESS FULL| CUSTOMER                   |     1 |    30 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter("CUSTNO"=2)
    Result Cache Information (identified by operation id):
       1 - column-count=2; dependencies=(SCRATCHPAD.CUSTOMER); name="select /*+ RESULT_CACHE */ * FROM customer where custno=2"The same result cache reference is still there. So does this mean that result cache is NOT invalidated despite the row being updated or I am doing something wrong here?
    Thanks
    Edited by: 902986 on 12-Feb-2012 13:26

    The result cache id is a hash value for the query so that Oracle can later tell if a query will produce a result set that is already in the cache.
    When you updated the table the result set in the cache was marked invalid. Then you ran the same query for record 2 and Oracle created a hash value for the query and the hash value is the same as the first time since the query is the same; that is, the query itself hashes to the same value. But the result cache contents for that query have changed and replace the old invalid contents.
    If you query the result set cache you will get the new value not the old one since the old result set for your second query isn't there anymore.

  • EJB reference not bound

    I'm running JBoss 3.0.1 with Tomcat 4.0.4 bundle. I have successfully deployed a EJB to Jboss and created 2 clients (java & JSP client).
    For some reasons, I'm able to run the java client but when I try the JSP client (served by Tomcat) I get this error message
    javax.servlet.ServletException: Name greetings is not bound in this Context
    Below is the code for the 2 clients & web.xml
    <----------- jsp client -------------->
    <%@ page import="javax.naming.*,
    java.util.*,
              java.util.Hashtable,
              javax.rmi.PortableRemoteObject,
    com.stardeveloper.ejb.session.*"%>
    <%
    long t1 = System.currentTimeMillis();
    InitialContext ctx = new InitialContext();
    Object ref = ctx.lookup("ejb/First");
    FirstHome home = (FirstHome) PortableRemoteObject.narrow (ref, FirstHome.class);
    First bean = home.create();
    String time = bean.getTime();
    bean.remove();
    ctx.close();
    long t2 = System.currentTimeMillis();
    %>
    <html>
    <head>
    <style>p { font-family:Verdana;font-size:12px; }</style>
    </head>
    <body>
    <p>Message received from bean = "<%= time %>".<br>Time taken :
    <%= (t2 - t1) %> ms.</p>
    </body>
    </html>
    <----------- java client ------------->
    import javax.naming.*;
    import com.stardeveloper.ejb.session.*;
    import java.util.Hashtable;
    import javax.rmi.PortableRemoteObject;
    import com.stardeveloper.ejb.session.*;
    class firstEJBclient {
         public static void main(String[] args) {
              try {
                   long t1 = System.currentTimeMillis();
                   InitialContext ctx = new InitialContext();
                   System.out.println("Got CONTEXT");
                   Object ref = ctx.lookup("ejb/First");
                   System.out.println("Got REFERENCE");
                   FirstHome home = (FirstHome) PortableRemoteObject.narrow (ref, FirstHome.class);
                   First bean = home.create();
                   String time = bean.getTime();
                   bean.remove();
                   ctx.close();
                   long t2 = System.currentTimeMillis();
                   System.out.println("Message received from bean = "+time+" Time taken : "+(t2 - t1)+" ms.");
              catch (Exception e) {
                   System.out.println(e.toString());
    <----------------- web.xml -------------------->
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <session-config>
    <session-timeout>
              1800
    </session-timeout>
    </session-config>
    <welcome-file-list>
         <welcome-file>
              firstEJB2.jsp
    </welcome-file>
    </welcome-file-list>
    <ejb-ref>
         <description>A reference to an entity bean</description>
         <ejb-ref-name>ejb/First</ejb-ref-name>
         <ejb-ref-type>Stateless</ejb-ref-type>
         <home>com.stardeveloper.ejb.session.FirstHome</home>
         <remote>com.stardeveloper.ejb.session.First</remote>
    </ejb-ref>
    </web-app>
    Why is it not bound?

    Please Ignore my other Message(My META-INF was not in Root and now I am able to get my beans bound).
    I am using Jboss 3.0
    I am able to access service of my HelloWorld Session Bean through a jsp.
    But not able to do so using a java client.
    my directory structure is :
    com\ideas\users\<Bean classes(Remote Interface,home interface,Bean)>
    com\ideas\users\<Bean client(a java client)>
    My java client program is :
    import javax.rmi.*;
    import javax.naming.*;
    import java.util.*;
    import com.ideas.users.*;
    public class HelloWorld {
    public static void main( String args[]) {
    try{
    Properties p = new Properties();
              p.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
              p.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
              p.put("java.naming.provider.url","localhost");
              InitialContext ctx = new InitialContext(p);
              //Lookup the bean using it's deployment id
              Object obj = ctx.lookup("users/Hello");
    //Be good and use RMI remote object narrowing
    //as required by the EJB specification.
    HelloHome ejbHome = (HelloHome) PortableRemoteObject.narrow(obj,HelloHome.class);
    //Use the HelloHome to create a HelloObject
    Hello ejbObject = ejbHome.create();
    //The part we've all been wainting for...
    String message = ejbObject.sayHello();
    //A drum roll please.
    System.out.println( " run successfully and message is :" + message);
    } catch (Exception e){
    e.printStackTrace();
    I am able to compile but when i try to Run I get the following error message
    javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundException: org.jboss.proxy.ClientContainer (no security manager: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
    at java.io.ObjectInputStream.inputClassDescriptor(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.inputObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.inputClassFields(Unknown Source)
    at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
    at java.io.ObjectInputStream.inputObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.rmi.MarshalledObject.get(Unknown Source)
    at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:449)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at HelloWorld.main(HelloWorld.java:25)
    Please help me out .
    Thanks in advance
    Sujith

  • Clearing Safari Cache Automatically when it Quits

    I work for a school district that uses Safari 2.0.4 on eMac’s running 10.4.7 and 10.4.8 and the students have their network home folders located on a 10.4.8 Server.
    I would like to have Safari clear its cache every time a student quits Safari or logs out, but don’t see a way to have this done automatically. Is there a script or utility out there that clears the cache automatically?
    Thanks for the help!

    Hello again,
    Ok, let's give this a go then
    Personally, for editing scripts I like to use the command line 'vi' editor, but for starting with that may scare you off so lets use the regular TextEditor application for the time being.
    Fire up TextEditor and open a new document. Change the type of the document to be a plain text file. This can be done via the Format menu -> Make Plain Text option (if it says Make Rich Text, then the file is already in plain text mode).
    In the editor, copy and paste the following, but remove the line numbers I've added:
    1 #!/bin/bash
    2
    3 logFile=/tmp/SafariCleanerLog.txt
    4
    5 echo "-----------------" >> $logFile
    6 echo `date` >> $logFile
    7 echo "" >> $logFile
    8 echo "Deleting Safari cache files in: $HOME/Library/Caches/Safari/" >> $logFile 2>&1
    9 echo "" >> $logFile
    10
    11 rm -rf $HOME/Library/Caches/Safari/* >> $logFile 2>&1
    Some lines may appear to wrap around in the webpage, so use the line numbers as your guide to know if something is supposed to fit on one line or not.
    This is what it does:
    - The 1st line indicates what particular shell application to use to execute this script (/bin/bash in this case)
    - The 3rd creates a variable that I'm using to store the path to a log file for what this script is doing
    - Lines 5 to 9 append some logging information to the logfile we've decided to report to
    - Line 11 does the actual deletion of the Safari cache files. rm is short for remove, aka delete, and the -rf means recursively (i.e. all subdirectories in the Safari cache folder) and forceably (i.e. don't askif you are sure for each and every file). The cryptic 2>&1 at the very end is to make any error messages that rm might generate appear in our logfile. If you try out the commands to see how they work, please please please be very careful with rm, once a file has been rm'ed its gone - it doesn't go to the Trashcan
    Note that if you want to see more about what each of these commands do, you can use the man pages either from the Terminal itself or here. ('echo' is a built-in command to bash, so you would need to read the bash manpage for information on that)
    Ok, so now we have a script. Save that on your Desktop with a name that makes sense for you (e.g. SafariCacheCleaner.sh - sh is the standard extension used to indicate something is a script, it's not required)
    Now we need to execute a few Terminal commands to make this work when a student logs out. Fire up the Terminal from /Applications/Utilities/Terminal.app
    The first thing we need is somewhere to place the script that is out of bounds to regular users, students, etc. OS X already has an area for scripts in /Library/Scripts/, so you may want to create your own area under this folder. For example, I created a 'Custom' folder via the following:
    sudo mkdir /Library/Scripts/Custom
    You may want to replace Custom with something else, like SchoolAdmin for instance. sudo is a command that gives the executor temporary administration rights. When you press return after typing the above command, you will be asked for a password - enter the password for your current user account and press return (note that you will not see anything appear in the Terminal while you are typing, this is a security feature).
    Next up, we need to copy the script to this location and give it the correct permissions to be executed:
    sudo cp ~/Desktop/SafariCacheCleaner.sh /Library/Scripts/Custom/
    sudo chmod 755 /Library/Scripts/Custom/SafariCacheCleaner.sh
    In this case, sudo will probably not prompt you for the password as it trusts access for a few minutes. If you leave things for, say, 10 minutes, it would ask you for your password again.
    cp is the command for copying files/folders.
    chmod is used to change permissions on a file. In this case, 7 means the owner of the file can write/read/execute the file, the first 5 means anyone in the same unix group as the owner can read/execute the file and the second 5 means everyone else can read/execute it.
    Lastly, we need to tell OS X that we want this script to run everytime a user logs out. This can be done with the following command (this is one long line that the browser may wrap):
    sudo defaults write com.apple.loginwindow LogoutHook /Library/Scripts/Custom/SafariCacheReset.sh
    Hopefully, that should be it. You can test it out by logging out of your account and logging back in. The /Users/YourUsername/Library/Caches/Safari/ should be sparkling clean now.
    I've tried to be a bit verbose to explain what's going on, so it's not as complex as it may look at first.
    If you have any questions at all, feel free to ask - it's better to be sure of what you are doing when it comes to the Terminal sometimes.

  • FS Cache Ref queue issue

    I have an issue with object.wait and reference queue lock issue. The web logic server thread hung up and indicate "local Variable unavailable". From thread dump, it appears it is waiting for a cache reference queue lock. Any one can give some direction how to further debug on the case. Here is the exception of the dump thread:
    Full thread dump Java HotSpot(TM) Server VM (1.5.0_04-b05 mixed mode):
    "FSCacheRefQueueThread" daemon prio=2 tid=0x2c848738 nid=0x16c4 in Object.wait() [0x3016f000..0x3016fd9
    at java.lang.Object.wait(Native Method)
    - waiting on <0x09a6c8d0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
    - locked <0x09a6c8d0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
    at workshop.util.filesystem.FSCache$FSCacheRefQueueThread.run(FSCache.java:65)
    "AgentConfigMonitor" daemon prio=2 tid=0x2c658800 nid=0x13c0 waiting on condition [0x3012f000..0x3012fa
    at java.lang.Thread.sleep(Native Method)
    at com.sun.identity.agents.arch.AgentConfiguration$ConfigurationMonitor.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:595)
    "LDAPConnThread-6 ldap://devldap.usarec.army.mil:389" daemon prio=5 tid=0x2c5d53e8 nid=0x123c runnable
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
    - locked <0x09cb2878> (a java.io.BufferedInputStream)
    at netscape.ldap.ber.stream.BERElement.getElement(BERElement.java:101)
    at netscape.ldap.LDAPConnThread.run(LDAPConnThread.java:538)
    at java.lang.Thread.run(Thread.java:595)
    "LDAPConnThread-5 ldap://devldap.usarec.army.mil:389" daemon prio=5 tid=0x2d4471d8 nid=0x13f0 runnable
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
    - locked <0x09cb4958> (a java.io.BufferedInputStream)
    at netscape.ldap.ber.stream.BERElement.getElement(BERElement.java:101)
    at netscape.ldap.LDAPConnThread.run(LDAPConnThread.java:538)
    at java.lang.Thread.run(Thread.java:595)
    "Thread-19" daemon prio=5 tid=0x2c381b70 nid=0x173c waiting on condition [0x3002f000..0x3002fd18]
    at java.lang.Thread.sleep(Native Method)
    It is web logic 9.2.
    Any work around? Is that a dead lock?
    Thanks!

    The root cause seems to be caused by
    workshop.util.filesystem.FSCache$FSCacheRefQueueThread.
    Are you running this application from within WebLogic Workshop?
    Can you see if you can deploy externally to workshop?

  • Accessing a Cache From an Oracle CQL User-Defined Function

    According to the docs ...
    I am to use the following element to set the cache property in my bean...
    <wlevs:property name="cache" ref="cache-id"/>
    However, when I set it, the assembly does not validate.
    If I use <property>, I get a NullPointerException on each request when my processor runs.
    Using the same CQL code..
    Without the <property> tag, the call to the user-defined function works (but I don't have the cache attribute set obviously).
    Here is the excerpt from my assembly...
    <bean id="cacheFunction" class="ou.cep.function.CacheFunction">
    <property name="cache" ref="myCache"/>
    </bean>
    <!-- The default processor for OCEP 11.0.0.0 is CQL -->
    <wlevs:processor id="myProcessor">
    <wlevs:listener ref="CacheChannel"/>
    <wlevs:function ref="cacheFunction" function-name="isValidID" exec-method="isValidID">
    </wlevs:function>
    </wlevs:processor>
    To repeat, with the same CQL with the user-defined function call, if I remove the property element from the bean definition, I can call the function successfully (it just doesn't do what I need it to do). In this case, I am still using the ref=cacheFunction for the wlevs:function within the processor.
    What am I doing wrong?
    Edited by: fl0at on Oct 5, 2010 12:22 PM
    Edited by: fl0at on Oct 5, 2010 12:28 PM

    The case is solved, not sure I could explain why, but...
    This implementation of the user-defined function was a migration from an implementation using the same cache in the join. So, when I removed the cache reference in the source stream (where I am now executing a function that accesses the cache), the problem went away and everything is working.
    I can explain further if there are questions.
    If anyone has thoughts on this, please advise.
    As always, thanks for the help.

  • Communicating between spring and cache-config

    Hi,
    I've the following definition for one of the schemes.
    <distributed-scheme>
         <scheme-name>data_distributed</scheme-name>
         <service-name>DistributedDataCache</service-name>
         <listener>
              <class-scheme>
                   <class-name>spring-bean:AbcMapTriggerListener
                   </class-name>
              </class-scheme>
         </listener>
         <backing-map-scheme>
              <local-scheme>
                   <listener>
                        <class-scheme>
                             <class-name>
                                  a.b.c.AbcBackingMapListener
                             </class-name>
                             <init-params>
                                  <init-param>
                                       <param-type>com.tangosol.net.BackingMapManagerContext
                                       </param-type>
                                       <param-value>{manager-context}</param-value>
                                  </init-param>
                             </init-params>
                        </class-scheme>
                   </listener>
              </local-scheme>
         </backing-map-scheme>
         <backup-count>0</backup-count>
         <autostart>true</autostart>
    </distributed-scheme>I'll need to get the AbcBackingMapListener initialized with another cache reference and some custom objects. How can I pass those references to the constructor (or by using setters)?
    I tried using <class-scheme> inside the <param-value> element, but that didn't work.
    <param-value>
         <class-scheme>
              <class-name>spring-bean:CustomObject
              </class-name>
         </class-scheme>
    </param-value>Any suggestions would be appreciated.

    Hi Sijo,
    To use another scheme as an init-param you need to use a scheme-ref as described here in the Parameter macro section of the documentation:
    http://download.oracle.com/docs/cd/E18686_01/coh.37/e18677/cache_config.htm#BABHCCHI
    <distributed-scheme>
        <scheme-name>data_distributed</scheme-name>
        <service-name>DistributedDataCache</service-name>
        <listener>
            <class-scheme>
                <class-name>spring-bean:AbcMapTriggerListener</class-name>
            </class-scheme>
        </listener>
        <backing-map-scheme>
            <local-scheme>
                <listener>
                    <class-scheme>
                        <class-name>
                            a.b.c.AbcBackingMapListener
                        </class-name>
                        <init-params>
                            <init-param>
                                <param-type>com.tangosol.net.BackingMapManagerContext</param-type>
                                <param-value>{manager-context}</param-value>
                            </init-param>
                            <!-- This will use an instance of the class created by the custom-object-scheme as the parameter -->
                            <init-param>
                                <param-type>{scheme-ref}</param-type>
                                <param-value>custom-object-scheme</param-value>
                            </init-param>
                            <!-- You can use a NamedCache as a paremeter like this, where the param-value is the cache name -->
                            <init-param>
                                <param-type>{cache-ref}</param-type>
                                <param-value>anotherCache</param-value>
                            </init-param>
                        </init-params>
                    </class-scheme>
                </listener>
            </local-scheme>
        </backing-map-scheme>
        <backup-count>0</backup-count>
        <autostart>true</autostart>
    </distributed-scheme>
    <class-scheme>
        <scheme-name>custom-object-scheme</scheme-name>
        <class-name>spring-bean:CustomObject</class-name>
    </class-scheme>It works fine, we use it to pass data sources into cache stores and also to create ContinuousQueryCaches via the cache-config.
    JK

Maybe you are looking for