Using cache just for some classes

Hi,
I'd like to use datastore cache just for some persistent objects. The
cache should be active just for some objects and disabled for some other
objects.
The only one way I found is the following: I defined the default cache
time-out to 0 millisecs and this value is overridden for a particular
class in the jdo metadata.
For example, these are the global properties:
     <config-property name="dataCache" value="true"/>
     <config-property name="dataCacheTimeout" value="0"/>
and this is the jdo metadata:
<extension vendor-name="kodo" key="data-cache-timeout" value="10000"/>
It works, but I don't like it. I'd like to turn off the cache in some way
for classes that doesn't need it. I tryed to create a custom cache in this
way:
<config-property name="dataCache" value="false, true(Name=myCache)"/>
or
<config-property name="dataCache" value="false(Name=default),
true(Name=myCache)"/>
but Kodo says that a cache named "default" must be configured and error is
raised.
What happens when the cache timeout is 0? If the cache is read every time
with 0 hits, I think that this is no good for performances, it would be
better not reading the cache at all...

Your best bet is to use the data-cache metadata extension in those
classes that you don't want cached:
<class name="MyVolatileClass">
<extension vendor-name="kodo" key="data-cache" value="false"/>
</class>
If most of your classes should not be cached, you could also set the
default cache's size (and soft reference size) to zero. This will,
however, incur a small performance overhead.
-Patrick
Claudio Tasso wrote:
Hi,
I'd like to use datastore cache just for some persistent objects. The
cache should be active just for some objects and disabled for some other
objects.
The only one way I found is the following: I defined the default cache
time-out to 0 millisecs and this value is overridden for a particular
class in the jdo metadata.
For example, these are the global properties:
     <config-property name="dataCache" value="true"/>
     <config-property name="dataCacheTimeout" value="0"/>
and this is the jdo metadata:
<extension vendor-name="kodo" key="data-cache-timeout" value="10000"/>
It works, but I don't like it. I'd like to turn off the cache in some way
for classes that doesn't need it. I tryed to create a custom cache in this
way:
<config-property name="dataCache" value="false, true(Name=myCache)"/>
or
<config-property name="dataCache" value="false(Name=default),
true(Name=myCache)"/>
but Kodo says that a cache named "default" must be configured and error is
raised.
What happens when the cache timeout is 0? If the cache is read every time
with 0 hits, I think that this is no good for performances, it would be
better not reading the cache at all...

Similar Messages

  • Hi, I have used PDF export for some years. One file will NOT convert to readable text in Word.  Some

    Hi, I have used PDF export for some years. One file will NOT convert to readable text in Word.  Some headers and maps in this document are converted OK but the body text is garbled. I have tried converting to Docx, Doc and RTF with no success. I disabled OCR and it made no difference. What can I do please?
    Les

    Hi,
    Can you please provide me the file with which you are facing the issue.
    Thanks

  • I have been using Itunes Apps for some time. Today I signed to Itunes to get Apps updated. Apple said I must update my account. I did that with a new password. Itunes said invalid support. Now what can I do?

    I have been using Itunes Apps for some time. Today I signed to Itunes to get Apps updated. Apple said I must update my account. I did that with a new password. Itunes said invalid support. Now what can I do?

    What do you mean "invalid support"? What EXACTLY did it say? Did it say you had an unsupported SIM after updating the firmware on your phone?

  • Can i use this just for audio

    I want to know if i can use this just for audio ..not the picture part

    I don't see a way of using FT just for audio.  There is no way of turning the video streaming feature to off.  If you disable the camera, facetime won't work at all.

  • I have been using Voice memos for some time but now I get a message to say No Microphone Available how do I get the function working again?

    I have been using Voice memos for some time but now I get a message to say No Microphone Available how do I get the function working again?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • About to use my tree for some firewood  :o(

    I was wondering if someone could maybe clue me into a problem that I am having with my DefaultMutableTree. See, I call a recursive method to get the file system of the computer, which is what is added to the tree. So the user is looking at a tree structure of the file system of their computer. My problem is that when I compile and run my program the tree shows up fine, with no hitches. I have given my code to other friends, and for some of them it does not show up, and throws a null pointer exception at the internal interface of this recursive method. I was wondering what might be causing this? My friends that have problems with the code are running either WIN XP, or Mac OS 10.1.4. Here is the code for the initialization of the tree (This will look ugly on the post, so I would hope that you would take the time to copy and paste this into your editor :D)
    //code start.
    import java.io.*;
    import java.io.File;
    import java.lang.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.beans.*;
    import javax.swing.JTree;
    import javax.swing.tree.DefaultMutableTreeNode;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.tree.TreeSelectionModel;
    public class File_Encryptor extends JFrame {
    private JFrame thisFrame = this;
    private JTree tree;
    private JMenuBar jMenuBar1 = new JMenuBar();
    private JMenuItem menuOpen = new JMenuItem("Open");
    private JMenuItem menuSave = new JMenuItem("Save");
    private JMenuItem menuClose = new JMenuItem("Close");
    private JMenuItem menuQuit = new JMenuItem("Quit");
    private JMenuItem menuAbout = new JMenuItem("About this software...");
    private JMenuItem menuAdd = new JMenuItem("Add key and user");
    private JMenuItem menuChange = new JMenuItem("Change buddy key");
    private JMenuItem menuSend = new JMenuItem("Send your buddy key");
    private JMenuItem menuDelete = new JMenuItem("Delete selected buddy key");
    private JMenuItem menuReset = new JMenuItem("Reset your key");
    private JMenuItem menuChangeLogin = new JMenuItem("Change Login");
    private JMenuItem menuHelp = new JMenuItem("Help...");
    private JButton openDir = new JButton("Open path");
    private JTextField jTextField1 = new JTextField();
    private JScrollPane treeView;
    private JScrollPane imageView;
    private JScrollPane textView;
    private String ROOT;
    private File root;
    private DefaultMutableTreeNode top;
    final private DefaultMutableTreeNode FILLER = new DefaultMutableTreeNode(new FileInfo ("about:blank", "about:blank"));
    public File_Encryptor() throws FileNotFoundException, InterruptedException, IOException, ClassNotFoundException {
    super("FILE ENCRYPTOR 1.0");
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    ROOT = getRoot(System.getProperty("user.home"));
    root = new File(ROOT);
    try{
    //Create the nodes.
    top = unfold(root);
    top.setUserObject(new FileInfo(ROOT,ROOT));
    tree = new JTree(top);
    tree.getSelectionModel().setSelectionMode
    (TreeSelectionModel.SINGLE_TREE_SELECTION);
    Object nodage = top.getNextNode().getUserObject();
    FileInfo leaf = (FileInfo) nodage;
    tree.addTreeSelectionListener(new TreeSelectionListener() {
    public void valueChanged(TreeSelectionEvent e) {
    DefaultMutableTreeNode node = (DefaultMutableTreeNode)
    tree.getLastSelectedPathComponent();
    if (node == null) return;
    try{
    Object nodeInfo = node.getUserObject();
    FileInfo temp = (FileInfo) nodeInfo;
    if((node.isLeaf()) && (!(node.isRoot())))
    System.out.println(temp.Path());
    //figure out how to place file in editor pane.
    else
    return;
    catch(Exception fubar)
    fubar.printStackTrace();
    treeView = new JScrollPane(tree);
    treeView.setSize(150,450);
    jTextField1.setMaximumSize(new Dimension(50, 100));
    jTextField1.setText("PATH");
    this.getContentPane().add(jTextField1, BorderLayout.EAST);
    this.getContentPane().add(treeView, BorderLayout.WEST);
    catch(Exception e) {
    e.printStackTrace();
    jMenuBar1.setBorder(BorderFactory.createEtchedBorder());
    JMenu menu = new JMenu("File");
    JMenu about = new JMenu("Help");
    JMenu keys = new JMenu("Keys");
    JMenu change = new JMenu("Login");
    menuQuit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.META_MASK));
    menuQuit.setEnabled(true);
    menuQuit.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    System.exit(0);
    menu.add(menuQuit);
    jMenuBar1.add(menu);
    jMenuBar1.add(keys);
    jMenuBar1.add(change);
    jMenuBar1.add(about);
    this.setJMenuBar(jMenuBar1);
    public class FileInfo {
    private String path = "";
    private String name = "";
    public FileInfo(String p , String n){
    path = p;
    name = n;
    public String toString(){
    return name;
    public String Path(){
    return path;
    public static String getFileEx(String po){
    String ext = "";
    int i = po.lastIndexOf('.');
    if(i > 0)
    ext = po.substring(i-1);
    else
    ext = null;
    return ext;
    private DefaultMutableTreeNode unfold(File path) {
    DefaultMutableTreeNode node = new DefaultMutableTreeNode("");
    Vector Files = new Vector();
    Vector Direc = new Vector();
    if((path.isDirectory()) && (path.list().length != 0))
    node = new DefaultMutableTreeNode(new FileInfo(path.getPath(),path.getName()));
    File [] childs = path.listFiles();
    for(int j = 0; j < childs.length; j++)
    if(childs[j].isDirectory())
    Direc.addElement(childs[j]);
    else
    Files.addElement(childs[j]);
    for(int g = 0; g < Files.size(); g++)
    Direc.addElement((File)Files.elementAt(g));
    for(int i = 0; i < Direc.size(); i++)
    node.add(unfold((File)Direc.elementAt(i)));
    else if(!(path.isDirectory()))
    node = new DefaultMutableTreeNode(new FileInfo(path.getPath(),path.getName()));
    else
    node = new DefaultMutableTreeNode(new FileInfo(path.getPath(),path.getName()));
    node.add(new DefaultMutableTreeNode(new FileInfo(null,"<EMPTY FOLDER>")));
    return node;
    public static String getRoot(String path)
    int find = path.indexOf(System.getProperty("file.separator"));
    String root = path.substring(0,find + 1);
    return root;
    public static void main( String [ ] args )throws FileNotFoundException, InterruptedException, IOException, ClassNotFoundException {
    File_Encryptor show = new File_Encryptor();
    show.setSize(700, 500);
    show.setResizable(false);
    //show.setLocation(100,100);
    show.setVisible(true);
    //code end.
    //well there it is. Hope someone can help me with my problem.
    //I know this code is ugly, but I was trying a bunch of different
    //things hoping something would work. but ehh no such luck.
    //I am running windows 98, yea that's prolly my problem.
    //thank you for your time.

    I ran this on XP and got the null pointer exception...
    it's likely that it's running into a file or directory that it can't list (in my case it was a mount on a different directory ntfs is kinda cool)... SO... to handle that problem I just put the whole method in a try / catch block
    it was just the method unfold ... the fix returns a blank treenode... it should probably return null and the caller should see that as a sign to not add it to the tree...
         private DefaultMutableTreeNode unfold(File path) {
              DefaultMutableTreeNode node = new DefaultMutableTreeNode("");
              try
                   Vector Files = new Vector();
                   Vector Direc = new Vector();
                   if(path==null)
                        return(node);
                   if((path.isDirectory()) && (path.list().length != 0))
                   node = new DefaultMutableTreeNode(new FileInfo(path.getPath(),path.getName()));
                   File [] childs = path.listFiles();
                   for(int j = 0; j < childs.length; j++)
                   if(childs[j].isDirectory())
                   Direc.addElement(childs[j]);
                   else
                   Files.addElement(childs[j]);
                   for(int g = 0; g < Files.size(); g++)
                   Direc.addElement((File)Files.elementAt(g));
                   for(int i = 0; i < Direc.size(); i++)
                   node.add(unfold((File)Direc.elementAt(i)));
                   else if(!(path.isDirectory()))
                   node = new DefaultMutableTreeNode(new FileInfo(path.getPath(),path.getName()));
                   else
                   node = new DefaultMutableTreeNode(new FileInfo(path.getPath(),path.getName()));
                   node.add(new DefaultMutableTreeNode(new FileInfo(null,"<EMPTY FOLDER>")));
              catch (Exception e)
              return node;
         }

  • Facing issue using cache manifest for applications in iPad2

    Hi,
    I am facing issue while launching an application using cache manifest in ipad2, It needs a manually refresh to give the application in offline mode
    while the same application coming fine when changing the user agent of any developer browser to iOS ipad,Please suggest me if some splecial attribute needs to be set to make it work.
    Any Insight will be helpful.
    Thanks,
    DivyaP

    You have posted in the wrong space - please move your question to the BW/Bex related area.
    BI Platform is for Business Intelligence/Business Objects line of products.

  • Clicking magnets inside of iPad Air after using Smart Cover for some time

    I have read that many people experience clicking magnets inside of iPad Air after using Apple Smart Cover for some time.
    I experienced the same thing and returned the device to the shop where i bought it, while still having the warranty.
    They wrote me after 11 days of having my iPad that it is fixed and i can come for it, i was not yet there.
    Please tell me, how can i realize that they warranty serviced my iPad?
    I have read that many people get new device with same issue, and mine just got fixed somehow...
    It is not Apple Store it is Apple Premium Reseller, was their service OK or they just did not wanted to give me new device?
    How can i get to know they were acting correctly?
    Thanks for the answer

    Everything is OK, they gave my whole new iPad Air

  • I was not using my Iphone for some time and when i charged it for use the screen is not lighting up. the image is very dim . Please assist to correct this situation., I tried to increase the brightness.no use.

    Iphone 3 GS was not being used for some time. When I charged it for use the screen is not becomeing bright. The images are very dim although i increased the brightness. Pls assist.

    Since it's a new machine, contact Apple Service, iMac Service or Apple's Express Lane. Do note that if you have AppleCare's protection plan and you're within 50 miles (80 KM) of an Apple repair station, you're eligible for onsite repair since yours is a desktop machine. That also might apply to newly bought ones inside the first 90 days.
    FWIW, IMO, the AppleCare extended plan's the cheapest insurance you can get for your new desktop machine.

  • I'm using CC just for 5 days. its a trial version . when i want to make 3d from a text layer Photoshop quits.please help me out.

    Hello
    I'm having Photoshop CC just for 5 days.
    When I want to run 3d on some text Photoshop quits.
    Can anyone help me out .

    Good day!
    What are the Performance Preferences?
    What are the exact versions of Photoshop and the OS, GPU, …?
    Best practices: Usage | Adobe Community
    Regards,
    Pfaffenbichler

  • Using High-Level API, need to use KeyRelease just for Lists

    I'm coding a MIDlet with High-Level API, but I found that is really annoying to press down 30 times in a long List to reach the item you want to select. So I thought "what about pressing right/left and make it working like pressing down/up like 10 times"?
    Something like this:
    Canvas canvas = new Canvas() {
             public void paint(Graphics g) { }
             protected void keyPressed(int keyCode) {
                switch(keyCode) {
                    case -3:mylist.setSelectedIndex(mylist.getSelectedIndex()-10,true);break;
                    case -4:mylist.setSelectedIndex(mylist.getSelectedIndex()+10,true);
          }; // end of anonymous class*/But I have no idea about how to implement this =(

    first of all, is there any particular reason you want to stick to the high-level API?
    Well, I have already nearly 700 lines of code. I don't want to start from 0 :P
    I think the best way to implement this would be to use customItems so you can control the view of the list.
    I think that requires MIDP2.0 I'm trying to make it work in MIDP 1.0
    The best you could do with high level UI is add navigation Commands to the List.
    I have already 2 Commands per List. Not all phones have a button in the center of "cursors", so I use right button for select and left for back/exit.
    Thanks for replies anyway

  • Known Issue: "DNS server could not be reached" when creating or updating a RemoteApp collection using template images for some locales

    When trying to create or update Azure RemoteApp collections that use a template image for some non-EN-US locales, it might fail with error "DNS server could not be reached". You might also see error code "DnsNotReachable". 

    Cause:  There was a issue in Azure in which decimal punctuation was not treated properly if the locale of the template image used a comma (,) instead of a period (.).
    Workaround:  Before a fix was applied, the workaround was to use template images based on a locale that uses a period to delimit decimals, such as EN-US.
    Resolution:  As of March 19, 2015, a fix for this issue has been applied to Azure. You should once again be able to create collections from template images that use non-EN-US locales. If you continue to have this problem, please
    try the workaround. If that works and the only difference in the template images is the locale, please email remoteappforum (at Microsoft). If the workaround does not work, the issue is likely caused by a DNS configuration issue such as:
    No valid forwarders to public DNS servers configured on your internal DNS server(s).
    A valid internal DNS server is not specified on your Azure RemoteApp VNet.
    A VNet or internal network configuration issue is preventing the internal DNS servers from be reached by the VMs in the RemoteApp collection.

  • I have been using Thunderbird now for some time. Just experience issue where it doesn't allow me to sign in. Using same pass word as always. Any suggestions

    Just randomly yesterday my email stopped loading new messages. When I hit refresh a screen pops up and it asks me to log in with my password. I put in my password and it states password is incorrect.
    My email address is [email protected] Any suggestions

    Verify your password using webmail.

  • Problems using different tables for base class and derived class

    I have a class named SuperProject and another class Project derived from
    it. If I let SchemaTool generate the tables without specifying a "table"
    extension, I get a single TABLE with all the columns from both classes and
    everything works fine. But if I specify a "table" for the derived class,
    SchemaTool generates the derived class with just one column (corresponds
    to the attribute in derived class). Also it causes problems in using the
    Project class in collection attributes.
    JDO file:
    <jdo>
    <package name="jdo">
    <class name="Project" identity-type="application"
    persistence-capable-superclass="SuperProject">
    <extension vendor-name="kodo" key="table" value="PROJECT"/>
    </class>
    <class name="SuperProject" identity-type="application"
    objectid-class="ProjectId">
    <field name="id" primary-key="true"/>
    </class>
    </package>
    </jdo>
    java classes:
    public class Project extends SuperProject
    String projectSpecific
    public class SuperProject
    BigDecimal id;
    String name;
    tables generated by SchemaTool:
    TABLE SUPERPROJECTSX (IDX, JDOCLASSX, JDOLOCKX, NAMEX);
    TABLE PROJECT(PROJECTSPECIFICX)
    Thanks,
    Justine Thomas

    Justine,
    This will be resolved in 2.3.4, to be released later this evening.
    -Patrick
    In article <aofo2q$mih$[email protected]>, Justine Thomas wrote:
    I have a class named SuperProject and another class Project derived from
    it. If I let SchemaTool generate the tables without specifying a "table"
    extension, I get a single TABLE with all the columns from both classes and
    everything works fine. But if I specify a "table" for the derived class,
    SchemaTool generates the derived class with just one column (corresponds
    to the attribute in derived class). Also it causes problems in using the
    Project class in collection attributes.
    JDO file:
    <jdo>
    <package name="jdo">
    <class name="Project" identity-type="application"
    persistence-capable-superclass="SuperProject">
    <extension vendor-name="kodo" key="table" value="PROJECT"/>
    </class>
    <class name="SuperProject" identity-type="application"
    objectid-class="ProjectId">
    <field name="id" primary-key="true"/>
    </class>
    </package>
    </jdo>
    java classes:
    public class Project extends SuperProject
    String projectSpecific
    public class SuperProject
    BigDecimal id;
    String name;
    tables generated by SchemaTool:
    TABLE SUPERPROJECTSX (IDX, JDOCLASSX, JDOLOCKX, NAMEX);
    TABLE PROJECT(PROJECTSPECIFICX)
    Thanks,
    Justine Thomas
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • I have used Adobe Photoshop for some time and want to continue with it. Would I be wise to uninstall iphoto before installing adobe on my new Mac?

    I have loaded about 100 pictures into iPhoto on my new Mac (old PC user) but now am certain that I want to continue with Adobe Photoshop which I have used for quite some time. Should I uninstall iPhoto completely as well as removing the IPhoto Library? Please tell me how best to proceed so as to avoid conflicts.
    Thanks,
    Jerry

    I currently have Elements 9, but as I said I am a complete novice on the Mac.
    When I bought the Mac, I had all of my photos already on an external hd for securitiy purposes, and have since moved them onto the Mac hard drive. I have not yet imported them into iPhoto, although, as I mentioned above I have loaded some pix into iPhoto from a camera just to see how it works. Also I have not yet installed Elements 9 on the Mac.
    If I use IPhoto as the program to upload from the camera, do the photos go directly into iPhoto Library?
    Does the library function the same as my storing them in My Pictures/My Documents, etc on a pc? Can I move pictures about within the iPhoto Library?
    What is the advantage of using both programs simultaneously? If, as TeenTitan mentions above, I could put iPhoto back into the applications folder and not use it at all, and then use Elements 9 as the total package, what features, etc., would I lose?
    If I choose to move iPhoto into the app folder, is it a simple matter or dragging it back? If not, how should I do it?
    Thanks for your patience. I just want to get off to a clean start with my pictures. 

Maybe you are looking for

  • Audio out of sync

    I have 2 Xl2s. Both running at the same time taping a performance. One is using tape, the other a HD recorder. When I do the capture of both streams, I am unable to sync the audio and video. Something I have done many times before with other cameras.

  • Opinion sought on burning AVCHD to DVD

    I just completed my first 95 minute FCE movie in AVCHD only to be unpleasantly surprised to find that iDVD either does not support it, or does a very poor job on the material. So I read, for I have not tried it. For many reasons, I would like to comm

  • Duplicates of iTunes

    I just upgraded to itunes plus, and now my library has duplicates and some triplicates of the same songs. On my music list it shows only one listing, my question is: Can I get rid of the duplicates and triplicates from my library without affecting th

  • Handling .deb files in PKGBUILDs [Solved]

    Hi, I am looking for a package that uses .deb files, want to check out how to extract .debs Anyone know of a PKGBUILD that uses them or a way of extracting .debs ? Thanks

  • Service tax Hadling

    Dear all I want complete CIN cycle for service tax which will cover following 1. Service PO with tax code for service line item level ( what config required for the same ) 2. what is Importance of the tax code in service entry sheet 3.CENVAT Creadit