Creating Caches for faster browsing experiences

I really like the functionality with spry tabbed panels.  I am creating an online portfolio and in one of my pages, I would like to put up many documents that I have created over the years.  These documents (mainly pdfs) come from the root folder at average sizes of about 100kb per document.  I also tried to accomodate browsers who don't have built in PDF readers in their web browser (eg. firefox) by providing the document via a Scribd embed.
As a newb, i'm learning things on the fly and on this fly, i've discovered that with all these Scribd embeds loading up simultaneously, the page contains the set of tabbed panels can be quite slow.  Gramps has been awesome in suggesting that I use a user activated pop-up and by using caches. 
I understand how caches work, but not sure how I can actually code one into my site.
Is it standard protocol for people to use a cache manifest maker? 
How do I cache the embed codes given to me from scribd?
Where do I attach the manifest html code? at the top of every page?
If the data from the manifest is downloaded by the browser on page1, when the viewer navigates to page2, will the data still be accessible or will it require a second download.
Kale

Have a look here http://www.gayadesign.com/diy/caching-external-data-in-php/ and here http://www.profilepicture.co.uk/caching-api-responses-php/ or otherwise Google the subject.
Gramps

Similar Messages

  • Creating cache for multiple property files run time/dynamically.

    Hi,
    I have a requirement, where in I need to create cache for each property file present in a folder at server side or in the lib or resources directory. Please help me how I can do this?
    Thanks.

    ok thank you.
    I follwed this method implementation:
    static HashMap<String, HashMap<Object, String>> cacheHolder = new HashMap<String, HashMap<Object, String>>();
         static HashMap<Object, String>[] cache = new HashMap[2];
         static Integer fileCount = 0;
         static int incrementSize = 2;
    public method1(Map<Object,String>map){
    File file = new File((new StringBuilder(
                             "ABC/XYZ/")).append(value)
                             .toString()); // where value is the file name returned from the external method
                   int newSize = existingMapLength+incrementSize;
                   if (someVal== null) {                    
                        synchronized (fileCount) {
                             int oldSize = cache.length;
                             if(fileCount==cache.length){
                                  HashMap[] oldData = new HashMap[oldSize];
                                  oldData = cache;                              
                                  cache = new HashMap[newSize];
                                  LOGGER.info("New Size added:==>"+cache.length);
                                  for(int i=0;i<oldSize;i++){                                   
                                       cache[i] = oldData;
                                  cache[fileCount] = readExternalPropertiesFile(file); // external method which returns the properties of the file in hashmap
                                  cacheHolder.put(value, cache[fileCount]);                    
                                  keys = cache[fileCount].keySet();
                             else{                         
                             cache[fileCount] = readPropertiesFile(file);
                             cacheHolder.put(value, cache[fileCount]);                    
                             keys = cache[fileCount].keySet();
                             someVal= cache[fileCount];
    fileCount = fileCount + 1;
    Please let me know if any improvemnets are possible.

  • I have a macbook from early 2008, and when I sign onto safari I get an error message for fast browser search plugin.  After that error comes up my computer freezes and I have to force it to shut down.  Does anyone know what that means and how I can fix it

    I have a macbook from early 2008, and when I sign onto safari I get an error message for fast browser search plugin.  After that error comes up my computer freezes and I have to force it to shut down.  Does anyone know what that means and how I can fix it?

    Means you have an incompatible Safari extension installed. Look in the /Home/Library/Safari/Extensions/ folder for the offending plug-in and delete it.

  • Creating PKGBUILD for palemoon, browser based on firefox

    Hi,
    I'm relative new Arch user and I haven't done any packaging until today with Pale Moon. It is a web browser based on Mozilla Firefox and it has been build to linux just a while ago. The author of the project gave me permission to submit it to AUR. I would be happy to do it, but I don't have any previous experience with packaging. Could someone check the PKGBUILD that it is correct and adheres the AUR standards? And, anyone interested with more experience is free to take it over.
    The project home page is http://palemoon.org
    and the linux binaries are at http://sourceforge.net/projects/pm4linux/,
    Here is the PKGBUILD file. I used firefox-esr-bin as an example and copied the dependencies from it.
    # Maintainer: sumt <sumt at sci dot fi>
    pkgname=palemoon
    pkgver=24.3.1
    pkgrel=1
    pkgdesc="Browser based on Firefox that's optimised for performance."
    arch=('i686' 'x86_64')
    url="http://sourceforge.net/projects/pm4linux/"
    license=('MPL' 'GPL' 'LGPL')
    depends=('gtk2' 'dbus-glib' 'desktop-file-utils' 'libxt' 'mime-types' 'nss' 'shared-mime-info')
    optdepends=('networkmanager: Location detection via available WiFi networks'
    'gstreamer0.10-base-plugins: vorbis decoding, ogg demuxing'
    'gstreamer0.10-good-plugins: webm and mp4 demuxing'
    'gstreamer0.10-bad-plugins: aac, vp8 and opus decoding'
    'gstreamer0.10-ugly-plugins: h.264 and mp3 decoding'
    'gstreamer0.10-ffmpeg: more decoders'
    'libpulse: PulseAudio audio driver')
    install=$pkgname.install
    source=(http://downloads.sourceforge.net/pm4linux/$pkgname-$pkgver.en-US.linux-$CARCH.tar.bz2
    $pkgname.desktop)
    md5sums=('88fe69cd12baf1de15d58c1be5e68a2e'
    '220EDFF6FA5A275B53D7EDC1E6A3DB99')
    [ "$CARCH" == "i686" ] && md5sums[0]='065793af06c68a4491acb2fd1a9eda29'
    package() {
    cd $srcdir
    install -d $pkgdir/{usr/{bin,share/applications},opt}
    cp -r $pkgname/ $pkgdir/opt/$pkgname
    ln -s /opt/$pkgname/$pkgname $pkgdir/usr/bin/$pkgname
    install -m644 $srcdir/$pkgname.desktop $pkgdir/usr/share/applications/
    Results of namcap for the build package. Is there anything that I should be concerned about?
    > namcap palemoon-24.3.1-1-x86_64.pkg.tar.xz
    palemoon E: ELF file ('opt/palemoon/libnssdbm3.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libssl3.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/palemoon-bin') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/plugin-container') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/palemoon') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libmozalloc.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libplds4.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libsmime3.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libsoftokn3.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libxul.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libmozsqlite3.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/mozilla-xremote-client') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libnss3.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libplc4.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libfreebl3.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libnspr4.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libnssckbi.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/libnssutil3.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/webapprt-stub') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/browser/components/libbrowsercomps.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/components/libmozgnome.so') outside of a valid path.
    palemoon E: ELF file ('opt/palemoon/components/libdbusservice.so') outside of a valid path.
    palemoon W: Referenced library 'libmozsqlite3.so' is an uninstalled dependency
    palemoon W: Referenced library 'libxul.so' is an uninstalled dependency
    palemoon W: Referenced library 'libmozalloc.so' is an uninstalled dependency
    palemoon E: Dependency java-environment detected and not included (found class files opt/palemoon/distribution/bundles/[email protected]/chrome.jar, opt/palemoon/browser/chrome/browser.jar, opt/palemoon/browser/chrome/en-US.jar, opt/palemoon/chrome/marionette.jar, opt/palemoon/chrome/en-US.jar, opt/palemoon/chrome/toolkit.jar, opt/palemoon/chrome/recording.jar, opt/palemoon/chrome/pippki.jar, opt/palemoon/webapprt/chrome/en-US.jar, opt/palemoon/webapprt/chrome/webapprt.jar)
    palemoon W: Dependency alsa-lib detected but optional (libraries ['usr/lib/libasound.so.2'] needed in files ['opt/palemoon/libxul.so'])
    palemoon W: Dependency included and not needed ('mime-types')
    palemoon W: Dependency shared-mime-info included but already satisfied
    Last edited by up (2014-02-10 07:27:04)

    Well, I changed the path from /opt/palemoon to /usr/lib/palemoon, added icons to usr/share, and symlinked dictionary folders to use system-provided paths.
    Here is the new PKGBUILD,
    # Maintainer: sumt <sumt at sci dot fi>
    pkgname=palemoon
    pkgver=24.3.1
    pkgrel=1
    pkgdesc="Browser based on Firefox that's optimised for performance."
    arch=('i686' 'x86_64')
    url="http://sourceforge.net/projects/pm4linux/"
    license=('MPL' 'GPL' 'LGPL')
    depends=('gtk2' 'dbus-glib' 'desktop-file-utils' 'libxt' 'mime-types' 'nss' 'alsa-lib')
    optdepends=('networkmanager: Location detection via available WiFi networks'
    'gstreamer0.10-base-plugins: vorbis decoding, ogg demuxing'
    'gstreamer0.10-good-plugins: webm and mp4 demuxing'
    'gstreamer0.10-bad-plugins: aac, vp8 and opus decoding'
    'gstreamer0.10-ugly-plugins: h.264 and mp3 decoding'
    'gstreamer0.10-ffmpeg: more decoders'
    'libpulse: PulseAudio audio driver')
    install=palemoon.install
    source=(http://downloads.sourceforge.net/pm4linux/$pkgname-$pkgver.en-US.linux-$CARCH.tar.bz2
    $pkgname.desktop)
    md5sums=('88fe69cd12baf1de15d58c1be5e68a2e'
    '00d640ab6261fd1fb4adbadf79edd1f5')
    [ "$CARCH" == "i686" ] && md5sums[0]='065793af06c68a4491acb2fd1a9eda29'
    package() {
    install -d "$pkgdir"/usr/{bin,lib}
    cp -r palemoon/ "$pkgdir/usr/lib/$pkgname"
    ln -s "/usr/lib/$pkgname/palemoon" "$pkgdir/usr/bin/palemoon"
    install -Dm644 palemoon.desktop "$pkgdir/usr/share/applications/$pkgname.desktop"
    # icons
    install -Dm644 palemoon/browser/chrome/icons/default/default16.png \
    "$pkgdir/usr/share/icons/hicolor/16x16/apps/$pkgname.png"
    install -Dm644 palemoon/browser/chrome/icons/default/default32.png \
    "$pkgdir/usr/share/icons/hicolor/32x32/apps/$pkgname.png"
    install -Dm644 palemoon/browser/chrome/icons/default/default48.png \
    "$pkgdir/usr/share/icons/hicolor/48x48/apps/$pkgname.png"
    install -Dm644 palemoon/browser/icons/mozicon128.png \
    "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname.png"
    # use system-provided dictionaries
    rm -rf "$pkgdir"/usr/lib/$pkgname/{dictionaries,hyphenation}
    ln -s /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
    ln -s /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
    # avoid duplicate binaries
    # https://bugzilla.mozilla.org/show_bug.cgi?id=658850
    ln -sf palemoon "$pkgdir/usr/lib/$pkgname/palemoon-bin"
    and namcap results,
    > namcap palemoon-24.3.1-1-x86_64.pkg.tar.xz
    palemoon W: Referenced library 'libmozsqlite3.so' is an uninstalled dependency
    palemoon W: Referenced library 'libxul.so' is an uninstalled dependency
    palemoon W: Referenced library 'libmozalloc.so' is an uninstalled dependency
    palemoon E: Symlink (usr/lib/palemoon/hyphenation) points to non-existing /usr/share/hyphen
    palemoon E: Symlink (usr/lib/palemoon/dictionaries) points to non-existing /usr/share/hunspell
    palemoon E: Dependency java-environment detected and not included (found class files usr/lib/palemoon/distribution/bundles/[email protected]/chrome.jar, usr/lib/palemoon/browser/chrome/browser.jar, usr/lib/palemoon/browser/chrome/en-US.jar, usr/lib/palemoon/chrome/marionette.jar, usr/lib/palemoon/chrome/en-US.jar, usr/lib/palemoon/chrome/toolkit.jar, usr/lib/palemoon/chrome/recording.jar, usr/lib/palemoon/chrome/pippki.jar, usr/lib/palemoon/webapprt/chrome/en-US.jar, usr/lib/palemoon/webapprt/chrome/webapprt.jar)
    palemoon W: Dependency included and not needed ('mime-types')
    Any comments? Thanks.

  • Firewall cache for faster firefox setup downloads (squid cache)

    I am trying to configure a firewall system called pfSense that uses squid web cache as a component that I am trying to use. I work for a small ISP with a computer shop.
    We install Firefox for a safer browser alternative to IE. We would like for the setup file to be cached within our server for repetitive downloads.
    I am willing to admit that I'm a novice to firewall configuration and I think it may have to do with rege-x something else I am having issues with.

    It seems that entering 'localhost' rather than 'http://localhost' was what I needed.

  • Google Analytics OPT-OUT Browser Add-on 0.9.6 doesn't retain OPT-OUT settings...never did really. Also JAVA now refuses to create updates for WinXP/FireFox.

    I use PaleMoon now trying to get rid of advertising sharks. I have WINXP still - need assistive-technology computer for pain so taking time on getting new computer.
    I have been severely sabotaged by advertising conglomerates selling my private information. They have no right -yet they do whatever they want. Anyhow...I've tried to OPT-OUT of EVERYTHING POSSIBLE. I've tried 5 places found. Google, NAI, DAA, & FIREFOX HELP said go to about:config was instructed to turn "from false to true" the "privacy.tracking.protection.enabled" .But I couldn't keep this setting because this also has to be set to false to use any saved log-on's to my accounts., and add-on AD BLOCK PLUS 2.6.7 when I was on Firefox & had some ticks and now it is disabled because it won't work with PaleMoon 25.2.1
    This case is about GOOGLE OPT-OUT. Starting here: http://www.google.com/settings/ads?hl=en&sig=ACi0TCgWymel0CNWxdcnEWPzWNs9wDd7cVQHxHsmtz4w30CAyHk7MqyzzZdGh3m6FpDaJsKmunTLEvJZY5LAm3h6gIdzE30L-Q
    There are 2 columns. The left one "ADS ON GOOGLE" NEVER RETAINS AFTER LOG-OFF. The right column "Google ads across the web
    " seems to retain sometimes - if I remember right it falls off after a period of time as opposed to after just LOGGING-OFF. Below the columns there are options, but I don't have a GOOGLE ACCOUNT.
    Also down there is this link: https://support.google.com/adsense/troubleshooter/1631343?hl=en ...you see the box with this: Advertising industry program participation
    Google is a participating member of groups that have developed industry privacy standards like the Ad-Choices icon for online advertising.
    Group Location
    Network Advertising Initiative United States
    Digital Advertising Alliance (DAA) United States
    European Digital Advertising Alliance Europe
    Digital Advertising Alliance of Canada Canada
    ....I clicked OPTED OUT FOR NAI on their link http://www.networkadvertising.org/
    ...I clicked OPTED OUT FOR DAA on their link http://www.aboutads.info/
    ...I clicked PROTECT MY CHOICES and downloaded the app.
    These 1st 2 links used to have the same trouble and didn't retain ANYTHING and wouldn't re OPT-OUT ANY UNTIL THEY WERE SATIATED - saying I didn't have 3rd party cookies allowed when I did - this took hours.
    I sent numerous trouble reports to them that they ignored - then I think I sent one to Firefox and it is much better but still not completely right. Today DAA retains 106 out of 122 and if I repeatedly RE-OPT-OUT successively I can get it to 121 out of 122 - never completely. (currently the one not taking is Accuen Inc. but it changes periodically - makes me think they set one up to take my info and then share it with all of them - lol )
    Same for NAI currently I started with 94 out of 96 - next re-OPTED-OUT got it to 95 out of 96 and no further and same co. Accuen Inc (accuenmedia.com ) wouldn't update.
    NOTE: I was copy/pasting the list of NON-OPT-OUT'S to them and my own document file to try and find trends/problems...now NAI programmers protected the list from being able to be COPIED AND PASTED!!! That's the opposite of being open and interested in making this work, right? Why would they want to allow us to OPT-OUT of their criminal espionage behavior...RIGHT? (lol) FYI: I recorded that the big one that was always retained before this one was...MEDIA MATH INC.
    MANY Opt-outs would drop off while on-line and ALL would drop-off once logged-off. Now it's retaining most once logged off - but it hasn't been long enough to tell if they'll fall back into their bad habits as they've done before...
    This has been going on forever for me - I've been reporting this malfunction since 2013.
    Of course I downloaded PROTECT MY CHOICES FOR FIREFOX via NAI AND DAA'S links ...http://www.aboutads.info/PMC#protect-your-choices-for-firefox ............they both go to the same place???.....PROTECT MY CHOICES http://www.aboutads.info/plugin/install/firefox....that seems odd...it's as if they are the same entity then. ABOUTADS is DAA'S WEBSITE. NAI'S IS NETWORKADVERTISING.ORG so why would NAI use DAA'S PROTECT MY CHOICES app?
    Lastely, I also requested that the COOKIES NAMES BE UNIFORMLY IDENTIFIABLE. All the OPT-OUT COOKIES that are to be forevermore retained on my computer and that I am to trust the EVERY FUNCTION OF - well they all have different COOKIE NAMES!! Most of the names you can not tell that they are OPT-OUT COOKIES!! - SO NOWWW They have created another problem.
    We can no longer just "DELETE ALL COOKIES".
    PLUS, we can no longer go through our cookies and delete individual ones that snuck through.
    Every one of the OPT-OUT COOKIES SHOULD SAY "OPT-OUT" IWITHIN THEIR NAME OF THEIR COOKIE - PERIOD. RIGHT? (LOL) For real. Why was this mess was allowed?
    REALLY IN MY OPINION THESE COMPANIES SHOULD BE BLOCKED AT THE LOCAL PHONE COMPANIES LEVEL - IN OUR SERVERS. We should not have to deal with them. Same thing with viruses, malware and such beasts. But I digress.
    In summary:
    1.)Google Analytics OPT-OUT Browser Add-on 0.9.6 doesn't retain OPT-OUT settings
    2.) JAVA refuses to create updates for WinXP/FireFox/PaleMoon.
    3.) DAA & NAI still don't retain ALL OPT-OUT settings and never completely OPT-OUT all companies.
    4.) OPT-OUT cookies should be uniformly names with the words OPT-OUT in their titles.
    5.) Ad Block Plus 25.6.7 doesn't work for Pale Moon and there is no alternative - (didn't work great in FireFox)
    Right now I'm mainly interested in #1)retaining my GOOGLE OPT-OUTS while on line AND while logged off since it is attacking my computer and steeling all the speed until it freezes my keyboard.
    Currently I am trying to remember to run through 3. OPT-OUTS every time I log on.
    Thanks so much!

    hello, palemoon's support forums are here: http://forum.palemoon.org/

  • How to create a cache for JPA Entities using an EJB

    Hello everybody! I have recently got started with JPA 2.0 (I use eclipseLink) and EJB 3.1 and have a problem to figure out how to best implement a cache for my JPA Entities using an EJB.
    In the following I try to describe my problem.. I know it is a bit verbose, but hope somebody will help me.. (I highlighted in bold the core of my problem, in case you want to first decide if you can/want help and in the case spend another couple of minutes to understand the domain)
    I have the following JPA Entities:
    @Entity Genre{
    private String name;
    @OneToMany(mappedBy = "genre", cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<Novel> novels;
    @Entity
    class Novel{
    @ManyToOne(cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Genre genre;
    private String titleUnique;
    @OneToMany(mappedBy="novel", cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<NovelEdition> editions;
    @Entity
    class NovelEdition{
    private String publisherNameUnique;
    private String year;
    @ManyToOne(optional=false, cascade={CascadeType.PERSIST, CascadeType.MERGE})
    private Novel novel;
    @ManyToOne(optional=false, cascade={CascadeType.MERGE, CascadeType.PERSIST})
    private Catalog appearsInCatalog;
    @Entity
    class Catalog{
    private String name;
    @OneToMany(mappedBy = "appearsInCatalog", cascade = {CascadeType.MERGE, CascadeType.PERSIST})
    private Collection<NovelEdition> novelsInCatalog;
    The idea is to have several Novels, belonging each to a specific Genre, for which can exist more than an edition (different publisher, year, etc). For semplicity a NovelEdition can belong to just one Catalog, being such a Catalog represented by such a text file:
    FILE 1:
    Catalog: Name Of Catalog 1
    "Title of Novel 1", "Genre1 name","Publisher1 Name", 2009
    "Title of Novel 2", "Genre1 name","Pulisher2 Name", 2010
    FILE 2:
    Catalog: Name Of Catalog 2
    "Title of Novel 1", "Genre1 name","Publisher2 Name", 2011
    "Title of Novel 2", "Genre1 name","Pulisher1 Name", 2011
    Each entity has associated a Stateless EJB that acts as a DAO, using a Transaction Scoped EntityManager. For example:
    @Stateless
    public class NovelDAO extends AbstractDAO<Novel> {
    @PersistenceContext(unitName = "XXX")
    private EntityManager em;
    protected EntityManager getEntityManager() {
    return em;
    public NovelDAO() {
    super(Novel.class);
    //NovelDAO Specific methods
    I am interested at when the catalog files are parsed and the corresponding entities are built (I usually read a whole batch of Catalogs at a time).
    Being the parsing a String-driven procedure, I don't want to repeat actions like novelDAO.getByName("Title of Novel 1") so I would like to use a centralized cache for mappings of type String-Identifier->Entity object.
    Currently I use +3 Objects+:
    1) The file parser, which does something like:
    final CatalogBuilder catalogBuilder = //JNDI Lookup
    //for each file:
    String catalogName = parseCatalogName(file);
    catalogBuilder.setCatalogName(catalogName);
    //For each novel edition
    String title= parseNovelTitle();
    String genre= parseGenre();
    catalogBuilder.addNovelEdition(title, genre, publisher, year);
    //End foreach
    catalogBuilder.build();
    2) The CatalogBuilder is a Stateful EJB which uses the Cache and gets re-initialized every time a new Catalog file is parsed and gets "removed" after a catalog is persisted.
    @Stateful
    public class CatalogBuilder {
    @PersistenceContext(unitName = "XXX", type = PersistenceContextType.EXTENDED)
    private EntityManager em;
    @EJB
    private Cache cache;
    private Catalog catalog;
    @PostConstruct
    public void initialize() {
    catalog = new Catalog();
    catalog.setNovelsInCatalog(new ArrayList<NovelEdition>());
    public void addNovelEdition(String title, String genreStr, String publisher, String year){
    Genre genre = cache.findGenreCreateIfAbsent(genreStr);//##
    Novel novel = cache.findNovelCreateIfAbsent(title, genre);//##
    NovelEdition novEd = new NovelEdition();
    novEd.setNovel(novel);
    //novEd.set publisher year catalog
    catalog.getNovelsInCatalog().add();
    public void setCatalogName(String name) {
    catalog.setName(name);
    @Remove
    public void build(){
    em.merge(catalog);
    3) Finally, the problematic bean: Cache. For CatalogBuilder I used an EXTENDED persistence context (which I need as the Parser executes several succesive transactions) together with a Stateful EJB; but in this case I am not really sure what I need. In fact, the cache:
    Should stay in memory until the parser is finished with its job, but not longer (should not be a singleton) as the parsing is just a very particular activity which happens rarely.
    Should keep all of the entities in context, and should return managed entities form mehtods marked with ##, otherwise the attempt to persist the catalog should fail (duplicated INSERTs)..
    Should use the same persistence context as the CatalogBuilder.
    What I have now is :
    @Stateful
    public class Cache {
    @PersistenceContext(unitName = "XXX", type = PersistenceContextType.EXTENDED)
    private EntityManager em;
    @EJB
    private sessionbean.GenreDAO genreDAO;
    //DAOs for other cached entities
    Map<String, Genre> genreName2Object=new TreeMap<String, Genre>();
    @PostConstruct
    public void initialize(){
    for (Genre g: genreDAO.findAll()) {
    genreName2Object.put(g.getName(), em.merge(g));
    public Genre findGenreCreateIfAbsent(String genreName){
    if (genreName2Object.containsKey(genreName){
    return genreName2Object.get(genreName);
    Genre g = new Genre();
    g.setName();
    g.setNovels(new ArrayList<Novel>());
    genreDAO.persist(t);
    genreName2Object.put(t.getIdentifier(), em.merge(t));
    return t;
    But honestly I couldn't find a solution which satisfies these 3 points at the same time. For example, using another stateful bean with an extended persistence context (PC) would work for the 1st parsed file, but I have no idea what should happen from the 2nd file on.. Indeed, for the 1st file the PC will be created and propagated from CatalogBuilder to Cache, which will then use the same PC. But after build() returns, the PC of CatalogBuilder should (I guess) be removed and re-created during the succesive parsing, although the PC of Cache should stay "alive": shouldn't in this case an exception being thrown? Another problem is what to do when the Cache bean is passivated. Currently I get the exception:
    "passivateEJB(), Exception caught ->
    java.io.IOException: java.io.IOException
    at com.sun.ejb.base.io.IOUtils.serializeObject(IOUtils.java:101)
    at com.sun.ejb.containers.util.cache.LruSessionCache.saveStateToStore(LruSessionCache.java:501)"
    Hence, I have no Idea how to implement my cache.. Can you please tell me how would you solve the problem?
    Many thanks!
    Bye

    Hi Chris,
    thanks for your reply!
    I've tried to add the following into persistence.xml (although I've read that eclipseLink uses L2 cache by default..):
    <shared-cache-mode>ALL</shared-cache-mode>
    Then I replaced the Cache bean with a stateless bean which has methods like
    Genre findGenreCreateIfAbsent(String genreName){
    Genre genre = genreDAO.findByName(genreName);
    if (genre!=null){
    return genre;
    genre = //Build new genre object
    genreDAO.persist(genre);
    return genre;
    As far as I undestood, the shared cache should automatically store the genre and avoid querying the DB multiple times for the same genre, but unfortunately this is not the case: if I use a FINE logging level, I see really a lot of SELECT queries, which I didn't see with my "home made" Cache...
    I am really confused.. :(
    Thanks again for helping + bye

  • Create a cache for external map source - Error in parsing xml request.

    When doing the following:
    Create a cache for external map source
    I get "error in parsing xml request" when setting the following
    Map service Url:
    http://neowms.sci.gsfc.nasa.gov/wms/wms?version=1.3.0&service=WMS&request=GetCapabilities
    It looks like it is breaking on "&". Any suggestions?
    Rob

    Hi Chris,
    thanks for your reply!
    I've tried to add the following into persistence.xml (although I've read that eclipseLink uses L2 cache by default..):
    <shared-cache-mode>ALL</shared-cache-mode>
    Then I replaced the Cache bean with a stateless bean which has methods like
    Genre findGenreCreateIfAbsent(String genreName){
    Genre genre = genreDAO.findByName(genreName);
    if (genre!=null){
    return genre;
    genre = //Build new genre object
    genreDAO.persist(genre);
    return genre;
    As far as I undestood, the shared cache should automatically store the genre and avoid querying the DB multiple times for the same genre, but unfortunately this is not the case: if I use a FINE logging level, I see really a lot of SELECT queries, which I didn't see with my "home made" Cache...
    I am really confused.. :(
    Thanks again for helping + bye

  • Problem creating cache group for a table with data type varchar2(1800 CHAR)

    Hi,
    I am using TimesTen 7.0 with Oracle 10.2.0.4 server. While creating Cache Group for one of my table I'm getting the following error.
    5121: Non-standard type mapping for column TICKET.DESCRIPTION, cache operations are restricted
    5168: Restricted cache groups are deprecated
    5126: A system managed cache group cannot contain non-standard column type mapping
    The command failed.
    One of my filed type in oracle table is Varchar2(1800 CHAR). If I change the filed size to <=1000 it (E.g. Varchar2(1000 CHAR)) then the Create Cache command works fine.
    MyDatabase Character Set is UTF8.
    Is it possible to solve without changing the filed size in the Oracle Table?
    Request your help on this.
    Thanks,
    Sunil

    Hi Chris.
    The TimesTen server and the Oracle Client is installed on a 32-bit system.
    1. ttVersion
    TimesTen Release 7.0.5.0.0 (32 bit Linux/x86) (timesten122:17000) 2008-04-04T00:09:04Z
    Instance admin: root
    Instance home directory: /appl/TimesTen/timesten122
    Daemon home directory: /var/TimesTen/timesten122
    Access control enabled.
    2. Oracle DB details
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Oracle Client - Oracle Client 10.2.0.4 running in a 32 bit Linux/x86
    3. ODBC Details
    Driver=/appl/TimesTen/timesten122/lib/libtten.so
    DataStore=/var/TimesTen/data
    PermSize=1700
    TempSize=244
    PassThrough=2
    UID=testuser
    OracleId=oraclenetservice
    OraclePwd=testpwd
    DatabaseCharacterSet=UTF8
    Thanks,
    Sunil

  • How to create database item for fast formula?

    Hi,
    Is there any document for how to create database item for fast formula? I could not find in Metalink or this forum. Thanks.
    Andy

    Oracle ship many pre-delivered Database Items plus they're created automatically when you create Input Values (etc).
    There's often something already there for you. If there's not, you usually create Fast Formula functions to retrieve other data. You don't create your own custom DBIs; Oracle don't deliver APIs for that.

  • QuickTime 7 update changes Safari browsing experience for 10.3.9 Panther

    Dear friends,
    If this topic has been covered already, please forgive this posting. I have searched the Message Board on this and only found one post (which was back in October). I am running 10.3.9 Panther, and after updating from QT 6 to QT 7, I am seeing some odd behaviors in Safari.
    When I scroll up or down through a web page, the Flash or QT advertisements seem to "bob" up and down, and do not stay fixed in one place. (In fact, any QuickTime clip or Flash animation "bobs" up and down.) This is a definite change from my browsing experience when I had QT 6 installed (where everything was a fixed on the web page when I scrolled up or down). It is not the end of the world, but it is a bit annoying (especially since I will be experimenting with web development soon, and want to have an "accurate" view of my pages). Even movie trailers "bob" up and down when I select them from Apple's QT site.
    Has anyone else experienced this? Does anyone know what is going on from a technical standpoint? Thank you all for your time and efforts.
    NOTE: I have also posted this on the Safari Discussions, but since this problem appears to stem from QuickTime 7 (at least, that's my working theory), I thought I would post here as well.
    Chris
    eMac   Mac OS X (10.3.9)  

    I installed iLife 06 on my G5 1.8 DP running OSX 10.3.9 Panther. It required the install of QuickTime 7.0.4. Now, in Safari everytime I want to listen to a music clip and get the QT pop up music player, when I close the QT window, it crashes Safari. I used the link posted in quite a few threads here to deinstall QT 7.0.4 (and revert to QT 7.0.1), and the Safari/QT problem is gone.However, I have now lost features in the various iLife programs which will only work with QT 7.0.4. If it is any consolation, this problem was NOT unique to OSX 10.3.9. I had the same problem on my G4 PowerBook 1.5 12" as well. The solution was the same, but, with the loss of features in iLife 06. Hopefully, Apple will come out with some update SOON which remedies this conflict.

  • Automation for creating cache groups process

    Hi All,
    I've got ~100 tables in Oracle DB and I'd like to cache them.
    I dont want to define a 100 cache group because it is time consuming.
    Are there any method to automate the creating cache groups process?
    Thanks.

    Hi 928879,
    Unfortunately, there is no way to automate this process. You can write a script for unloading the tables' descriptions but the defining a cache groups (create read only cache group) you should write by hands.
    regards,
    Gennady

  • Creating Widgets for Google Services like Reader, ...

    How can I create widgets like this on my phone?
    http://store.ovi.com/content/70180
    Although N8's browser fully supports Google Reader/Calendar as an apple iphone, google redirects you to a page that have very basic functionalities on these services.
    Since google have very good support for these services on Android/Apple phones, i have searched and found these URLs for Google Reader/Calendar that has full functionalities on N8. 
    Google Reader : www.google.com/reader/i/?source=mog&gl=us
    Google Calendar: http://www.google.com/calendar/gp?source=mog&gl=us
    After that i created bookmarks for these on my phone and put shortcuts of these on my home screen but my problem is icons for the bookmarks are the same. can someone help me create some widgets like the one above or at least change icons of the bookmarks?

    as an update, I wanted to add that when firefox gets stuck, in the status bar at the bottom, it will usually say that it is trying to load ajax.googleapis.com (or something like that).
    I have also started opening the console in firefox (cmd+opt+k) to watch the behavior of sites when they load. Under the network tab in console, google type sites will take 76000+ ms to load. i am only beginning to use the console and don't know exactly what to do with it yet, so i will be experimenting and updating as i learn more.
    if i experience a loading hang with a google site in firefox, clearing the cache/history does not work. however, it seems like if i quit and restart firefox, the google site will then load. i am unsure whether this "clears" something in the browser or just gives the connection enough time to fix whatever is causing the hang.
    other possibilities: in console it seemed like one of the delayed site attributes was a javascript from google (a .js file) - it took 70000+ ms to load. perhaps there is a problem with javascript?

  • Safari quit unexpectedly while using the Fast Browser Search Plugin plug-in

    Hello,
    I had an automatic software update a few days ago which was fine but also doing an Itunes update yesterday as I was prompted to do so, I was using version 10 and updated to 10.1 which has also gone wrong as it is saying that my itunes library cannot be read is it was created in a newer version of itunes? as I was updating Im not sure why this is? I could have deleted my old itunes thinking that this was a NEW one? :/
    thats problem 1....
    Problem 2 is
    After the update, I received tan error message when I tried to open Safari. I accidently must have uploaded a "Fast Browser " as this was coming up in the corner of the google search engine, I ignored it as I just used my main search bar in google but now I am getting the following message  as seen below (itunes error also attached)
    I saw this link on this forum but it seems to bring me to a dead end? I tried using the attached but it brings me to a dead end after "Home"
    http://help.fastbrowsersearch.com/
    Can anyone help me please? Panic stations :?
    Thanks
    Nicola

    nicolac7 wrote:
    Hello,
    I had an automatic software update a few days ago which was fine but also doing an Itunes update yesterday as I was prompted to do so, I was using version 10 and updated to 10.1 which has also gone wrong as it is saying that my itunes library cannot be read is it was created in a newer version of itunes? as I was updating Im not sure why this is? I could have deleted my old itunes thinking that this was a NEW one? :/
    thats problem 1....
    Problem 2 is
    After the update, I received tan error message when I tried to open Safari. I accidently must have uploaded a "Fast Browser " as this was coming up in the corner of the google search engine, I ignored it as I just used my main search bar in google but now I am getting the following message  as seen below (itunes error also attached)
    I saw this link on this forum but it seems to bring me to a dead end? I tried using the attached but it brings me to a dead end after "Home"
    http://help.fastbrowsersearch.com/
    For the FastBrowser plugin, click here: http://support.apple.com/kb/TS3230?viewlocale=en_US
    See:  Manually uninstall third-party add-ons
    Look in the folders you see there for the FBrowser plugin. Just drag it to the Trash.
    Since this is the Safari forum, for issues with iTunes, best to post in that forum.
    https://discussions.apple.com/community/itunes/itunes_for_mac?forumID=789
    Click New to create a new topic.

  • Automated Basic Authenication with an Applet for the Browser

    Hi
    I like to automate web access to secured pages and proxies, which are
    proteced with a Basic Authenication scheme.
    The Basic Authentication within an Applet works really well, I get all the
    information I need when I attach the
    Authorization: Basic base64encodeUID_PW to the request Header.
    or
    if I use the Authenticator Class of the JDK1.5.
    My problem is that the browser do not notice that I already have a
    UID/Password combination for the desired web page and I don't want that the Dialog
    to enter the UID and Password comes up, when I access the Page later with the browser.
    When I did the same with a form based authorisation the URLConnection was
    setting the Cookie inside the browser implicitly, the showDocument() method
    displayed the secured page, because the browser used the cookie to access
    it.
    Is there any way to access the cache for the UID and Password of the
    browser to set these values, so when I invoke the showDocument() to
    display the page inside the browser, I don't have to enter the UID and
    Password again?
    My current code to authenticate myself is this, I also tried a direct
    socket connection and a HttpURLConnection there was no difference:
    String urlString =
    "http://www.demo.com/basicprotectedpage/index.html"
    AppletContext appCont = getAppletContext();
    //created password authenticator.
    mmAuthenticator myPassAuth = new mmAuthenticator(uid,pw);
    //setting password.
    Authenticator.setDefault(myPassAuth);
    //URL created.
    URL url = new URL(urlString);
    //opening connection
    URLConnection conn = url.openConnection();
    //setting do input and do output.
    conn.setDoInput(true);
    conn.setDoOutput(true);
    conn.setUseCaches(true);
    //Data Input Stream
    BufferedReader bin = new BufferedReader(new
    InputStreamReader(conn.getInputStream()));
    String inputLine;
    System.out.println("web page data " );
    while ((inputLine = bin.readLine()) != null)
    System.out.println(inputLine);
    bin.close();
    appCont.showDocument(new URL(urlString)); // this should
    display the secured page without the prompt for uid password
    Thank you in advance.
    Martin

    That is properly too late.
    However, I am working on a similar problem. This is my insight. If anybody know more than I do, please let me know.
    Using the applet, the Authenticator may not work due to the new JRE. I believe if you have the property file within your machine, you may get around this problem. Other than that, I have not figured out a way to get pass this security issue. Anybody have any thought on that ?
    To get around this issue, in your case, it is Basic Authentication; so it won't be too bad. You will need to write your own http client. which mean, you will need to be able to read the response from the server and send the proper header back to the server. At least that is how I did it.
    The problem I am facing now is doing Digest Authentication. I really hate to do all kind of work to get Digest working. Only if the Authenticator work for me.
    Hope that help.

Maybe you are looking for