Serialization and compression

i have 3 big HashMap in a class.
i want to serialize/deserialize this class using Externization and compression.
if any one have good example to share.

You must remove the zos.close() line.
As I said, you are engaged in a space-time tradeoff: if you want speed don't compress; if you want to save space, compress. As this is the RMI group I assume this is going over a network so saving space will also save you tranmission time, but it will cost you compression and decompression time. Whether it is all really worth it is a moot point: you will have to measure and see. It is sounding to me as though maybe it isn't worth it.
If you really think 'use of Externalizable interface is slower than default Serializable interface' (I don't), you could also try making it Serializable with the Map fields marked as transient, as follows:
private void
readObject(ObjectInputStream objectInput) throws
IOException, ClassNotFoundException
objectInput.defaultReadObject();
GZIPInputStream zos = new GZIPInputStream(objectInput);
     ObjectInputStream oos = new ObjectInputStream(zos);
     map1 = (Map) oos.readObject();
     map2 = (Map) oos.readObject();
     map3 = (Map) oos.readObject();
private void writeObject(ObjectOutputStream objectOutput)
throws IOException
objectOutput.defaultWriteObject();
GZIPOutputStream zos = new GZIPOutputStream(objectOutput);
ObjectOutputStream oos = new ObjectOutputStream(zos);
     oos.writeObject(map1);
     oos.writeObject(map2);
     oos.writeObject(map3);
     zos.finish();
}Alternatively get rid of all this and construct your outer ObjectOutputStream around a GZipOutputStream, and your outer ObjectInputStream around a GZipInputStream. If you're doing RMI this is not possible: there is a solution involving a client socket factory but it's pretty clumsy.

Similar Messages

  • RMI, SSL, and compression

    Hi,
    I am trying to find an example of how to create a custom socket factory for RMI that does SSL and compression. Doing either separately is easy, but it seems that using SSL precludes the use of a custom socket as one would want for compression. Any suggestions or pointers would be appreciated.
    Regards,
    Neal

    Thank you for the help. Sadly, I am still unable to wrap my brain around this one. I am hoping a concrete example will help out:
    public class SecureServerSocketFactory implements java.rmi.server.RMIServerSocketFactory, java.io.Serializable
        /** Creates new SSLServerSocketFactory */
        public SecureServerSocketFactory()
         * Create a server socket on the specified port (port 0 indicates
         * an anonymous port).
         * @param  port the port number
         * @return the server socket on the specified port
         * @exception IOException if an I/O error occurs during server socket
         * creation
        public java.net.ServerSocket createServerSocket( int port )
            throws java.io.IOException
             SSLSocketFactory sssf = null;
            ServerSocketFactory ssf = null;
            ClassLoader cl = this.getClass().getClassLoader();
             try
                // set up key manager to do server authentication
                SSLContext ctx;
                KeyManagerFactory kmf;
                TrustManagerFactory tmf;
                KeyStore ks;
                char[] passphrase = "xxxxxxxxxxxxxx".toCharArray();
                ctx = SSLContext.getInstance( "TLS" );
                kmf = KeyManagerFactory.getInstance( "SunX509" );
                tmf = TrustManagerFactory.getInstance( "SunX509" );
                ks = KeyStore.getInstance( "JKS" );
                ks.load( new FileInputStream( SimpleLocator.getInstanceValue( "ServerKeystore") ), passphrase );
                kmf.init( ks, passphrase );
                tmf.init( ks );
                ctx.init( kmf.getKeyManagers(), tmf.getTrustManagers(), null );
                // this is w/o compression
                //ssf = ctx.getSocketFactory();
            catch( Exception e ) { e.printStackTrace(); }
            // need to put ejp's idea to practice here...
            // create a LZMACompressedSocket
            // put it into server mode?
            // wrap in SSL?
            return socket;
        }Any help you can provide would be appreciated.
    On a related note, I do agree that compressing at this level likely will not help, but I want to try all solutions.
    Thanks again for your help.

  • Hello All... Back after a brief absence, things look a little bit different. I'm trying to take a 16 minute mini dv video and compress it for use on the web. I'm interested in any suggestions you may have on settings for the video and audio tracks. I'v

    Hello All...
    Back after a brief absence, things look a little bit different.
    I'm trying to take a 16 minute mini dv video and compress it for use on the web. I'm interested in any suggestions you may have on settings for the video and audio tracks. I've tried using Sorenson 3 (15 frames, key frames set to automatic, 320 x 240) for video and IMA 4:1 (mono) for audio. The resulting video looked great but the file size came in at about 255 Mb.
    Thanks!
    PowerMac G5 1.8 Dual   Mac OS X (10.4.3)  
    Message was edited by: Dan Foley

    Thank you for the replies.  Everyone was correct about the jack, interface, and phasing problems.  I have been unplugging my motu audio interface and then using headphones at work.  I have not changed any detailed audio output settings in logic.  When I read that the jack might be a problem I tried switching headphones.  This actually helped.  I am using dre-beats headphones and they seem to be having issues with the mac/jack-(the phasing/panning problems.  I can use these headphones with other devices but not the mac.  I have to use ipod ear buds and the phasing seems fixed.  Hopefully this information is helpful to someone else. 
    If anyone knows how to correct this issue please let me know its difficult to know what my final mixes are going to sound like and I have had to keep bouncing everything into i-tunes- sync to ipod and then listen in my car radio. 

  • RE: Cleaning and Compression Environment Repository

    Mark,
    I'm not sure what I did wrong the first time. I thought I
    covered all the bases, but just to be certain, I did the
    whole sequence again and now it works.
    Before, I did have problems restarting the environment,
    because the repository was locked. I had to kill a
    hanging process to solve the problem. Most likely
    it was this process that was interfering with my original
    attempts.
    With this script, you offered some very usefull infor-
    mation. Where did you get it? Like I said in my
    first posting, I couldn't find any documentation.
    The "help" function of "envedit" doesn't show any of
    the commands you used. No way, you stumbled
    on this by accident.
    Thanks,
    Pascal Rottier
    STP - MSS Support & Coordination Group
    Philip Morris Europe
    e-mail: [email protected]
    Phone: +49 (0)89-72472530
    +++++++++++++++++++++++++++++++++++
    Origin IT-services
    Desktop Business Solutions Rotterdam
    e-mail: [email protected]
    Phone: +31 (0)10-2428100
    +++++++++++++++++++++++++++++++++++
    /* Ever stop to think, and forget to start again? */
    -----Original Message-----
    From: [email protected]
    [SMTP:[email protected]]
    Sent: Wednesday, June 30, 1999 1:04 PM
    To: [email protected]
    Cc: [email protected]
    Subject: Re: Cleaning and Compression Environment Repository
    The script mentioned is the exact sequence of commands that should be
    used.
    Did you shutdown the environment first? You cannot clean an environment
    repository while the environment is online. I know that these commands
    work for both NT and Unix environment managers.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Mark,
    I'm not sure what I did wrong the first time. I thought I
    covered all the bases, but just to be certain, I did the
    whole sequence again and now it works.
    Before, I did have problems restarting the environment,
    because the repository was locked. I had to kill a
    hanging process to solve the problem. Most likely
    it was this process that was interfering with my original
    attempts.
    With this script, you offered some very usefull infor-
    mation. Where did you get it? Like I said in my
    first posting, I couldn't find any documentation.
    The "help" function of "envedit" doesn't show any of
    the commands you used. No way, you stumbled
    on this by accident.
    Thanks,
    Pascal Rottier
    STP - MSS Support & Coordination Group
    Philip Morris Europe
    e-mail: [email protected]
    Phone: +49 (0)89-72472530
    +++++++++++++++++++++++++++++++++++
    Origin IT-services
    Desktop Business Solutions Rotterdam
    e-mail: [email protected]
    Phone: +31 (0)10-2428100
    +++++++++++++++++++++++++++++++++++
    /* Ever stop to think, and forget to start again? */
    -----Original Message-----
    From: [email protected]
    [SMTP:[email protected]]
    Sent: Wednesday, June 30, 1999 1:04 PM
    To: [email protected]
    Cc: [email protected]
    Subject: Re: Cleaning and Compression Environment Repository
    The script mentioned is the exact sequence of commands that should be
    used.
    Did you shutdown the environment first? You cannot clean an environment
    repository while the environment is online. I know that these commands
    work for both NT and Unix environment managers.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • HTTP Headers - enabling caching and compression with the portal?

    Has anyone configured their web server (IIS or Apache) or use a commercial product to flawlessly cache and compress all content generated by the portal?
    Compression and caching is critical for making our portal based applictions work for overseas users. It should be doable, just taking advantage of standard HTTP protocols, but implementing this a complex system like the portal is tricky, we seem to be generating different values in the HTTP Headers for the same types of files (such as CSS).
    We are running Apache so can't take advantage of the built in compression capabilities of the .net portal. We are running the java vervion. 6.1 mp1, sql server 2000 (portal, search, collab, publisher, studio, analytics, custom .net and java portlets on remote server).
    Basically our strategy is to compress all outgoing static and dynamic text content (html, CSS, javascript), and to cache all static files (CSS, javascript, images) for 6 months to a year depending on file type.
    Here are some links on the subjects of caching and compression that I have compiled:
    Caching & Compression info and tools
    http://www.webreference.com/internet/software/servers/http/compression/
    http://www.ibm.com/developerworks/web/library/wa-httpcomp/
    http://www.mnot.net/cache_docs/
    http://www.codeproject.com/aspnet/HttpCompressionQnD.asp?df=100&forumid=322472&exp=0&select=1722189#xx1722189xx
    http://en.wikipedia.org/wiki/Http_compression
    http://perl.apache.org/docs/tutorials/client/compression/compression.html
    https://secure.xcache.com/Page.aspx?c=60&p=590
    http://www.codinghorror.com/blog/archives/000807.html
    http://www.howtoforge.com/apache2_mod_deflate
    http://www.ircache.net/cgi-bin/cacheability.py
    http://betterexplained.com/articles/how-to-optimize-your-site-with-http-caching/
    http://betterexplained.com/articles/speed-up-your-javascript-load-time/
    http://betterexplained.com/articles/speed-up-your-javascript-load-time/
    http://www.rubyrobot.org/article/5-tips-for-faster-loading-web-sites
    http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/
    http://www.gidnetwork.com/tools/gzip-test.php
    http://www.pipeboost.com/
    http://www.schroepl.net/cgi-bin/http_trace.pl
    http://leknor.com/code/gziped.php?url=http%3A%2F%2Fwww.google.com
    http://www.port80software.com/surveys/top1000compression/
    http://www.rexswain.com/httpview.html
    http://www.15seconds.com/issue/020314.htm
    http://www.devwebpro.com/devwebpro-39-20041117DevelopingYourSiteforPerformanceCompressionandOtherServerSideEnhancements.html
    http://www.webpronews.com/topnews/2004/11/17/developing-your-site-for-performance-optimal-cache-control
    http://www.sitepoint.com/print/effective-website-acceleration
    http://nazish.blog.com/1007523/
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/IETechCol/dnwebgen/IE_Fiddler2.asp?frame=true
    http://www.fiddlertool.com/fiddler/version.asp
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
    http://www.web-caching.com/cacheability.html
    http://www.edginet.org/techie/website/http.html
    http://www.cmlenz.net/blog/2005/05/on_http_lastmod.html
    http://www.websiteoptimization.com/speed/tweak/cache/
    http://www.webperformance.org/caching//caching_for_performance.html
    http://betterexplained.com/articles/how-to-debug-web-applications-with-firefox/
    Edited by tkoenings at 06/18/2007 6:26 AM

    Hi Scott,
    Does Weblogic platform 8.1 supports netscape? We have developed a portal which
    works perfectly on IE but it dies in netscape. Is netUI tags not supported in
    Netscape?
    Pls reply
    manju
    Scott Dunbar <[email protected]> wrote:
    From a pure HTML perspective Portal does it's rendering with nested
    tables.
    Netscape 4.x and below have terrible performance with nested tables.
    The
    problem is not the Portal server but rather Netscape on the client machine.
    If IE and/or a recent version of Netscape/Mozilla is not possible then
    there are
    really only two options:
    1) Faster client hardware - not likely to be an acceptable solution.
    2) Minimize the number of portlets and the complexity within the portlets.
    Neither of these solutions are a great answer, but the 4.7 series of
    Netscape is
    getting pretty old. Having said that, we've got customers who want to
    continue
    to use IE 4 :)
    Again, though, this problem is, I'm afraid out of our hands. It is the
    client
    rendering time that is the issue.
    cg wrote:
    Does anyone know of any known reasons why the 7.0 (did it also with4.0) portal
    pages can take up to almost 30 seconds to load in Netscape 4.7? I knowit is a
    very generic question but our customer still uses 4.7 and will notuse the portal
    b/c it takes so long to load some of the webapps. What the pages willdo when
    loading is that the headers will come up and when it gets to the bodyof the page
    it seems to stall and then comes up all of a sudden. For some of thepages it
    takes 6 seconds and for others it takes about 24-27 seconds.
    We have suggested using IE only but that is not an option with allof the customers
    and getting a newer version of Netscape is also out of the question.
    Any suggestions would be greatly appreciated.--
    scott dunbar
    bea systems, inc.
    boulder, co, usa

  • MTS with batch management, serialization and Handling unit

    Hello All,
    I am testing a scenario for MTS with batch management, serialization and Handling unit for discrete manufacturing.
    Everything worked fine till I created the Handling unit for the finished product.
    The production order has a quantity of 3 EA.
    It has three serial numbers 1, 2 and 3. (serial numbers can be displayed from order->Header->serial numbers)
    I created one Handling unit for production order quantity of 3 EA.
    I tried to do a goods receipt for the production order using transaction COWBHUWE.
    I get the following error when I try to post the GR:
    Only 0 serial numbers entered instead of 3
    Message no. IO304
    Diagnosis
    There is a serial number obligation, so the number of serial numbers must equal the number of serial numbers in the material document.
    You can post the operation only if you entered the correct number of serial numbers previously.
    System Response
    Depending on the context in which the error arises, the system continues processing, or the required function cannot be performed.
    Procedure
    You have the following options, for example:
    Check that the serial numbers are entered fully.
    If necessary, display an error log.
    If necessary, contact your system administrator.
    What did I miss?
    How to fix this problem?
    Please help.
    Thanks in advance
    George

    I added the serialization procedure HUSL to the serial number profile and it fixed the problem.

  • How can I use my Mac G3 (OS 9.2.2) to make Windows disk images and compress them into Windows stuffed archives?

    I have a collection of old Windows diskettes, 800 K and 1.4 MB.  I want to make disk images (or whatever is the Windows equivalent) and compress them into Windows stuffed archives.  I want Windows users to be able to download them, expand the stuffed archives, extract the disk images, and use the softsare on old Windows computers.  I need to do the work on a Power Macintosh beige G3 Tower using OS 9.2.2.  What software can I get to do it?

    To Jan, Greetings
    Thank you for your message and for your suggestions.
    Is WinZip a Mac application that makes compressed files that can be opened on a Windows computer?  If so, then do you have any notion where I could find a version old enough to run on OS 9.2.2?
    I noticed that DropStuff 6.0, which I use on my G3 Tower, has an option to make compressed files that are self-extracting on Windows.  Do you know if that works?  I suppose that I could make such a file and then find somebody with a Windows computer to test if for me.
    Yes, I could (shudder) get an old Windows computer somewhere, learn to use it, and do the project that way.  Do you know if the old versions of Windows include disk image programs and file compression  programs?  Or, would I need to buy some old software?
    Thank you for the information about the size of the diskettes.  As you've probably noticed, I don't know very much about Windows things.
    Sincerely,
    Frontiersman

  • Dbms_redefinition package and COMPRESS attribute of the target table

    Hi experts,
    we have an already partitioned and compressed table under Oracle 10g R2 wich we want to move to another tablespace using online redefinition.
    The table should keep the Partitions and compressed data after the move.
    My question is: How much storage we must have in place for the move of the table ?
    Example:
    tab (compressed size) : 1000 MB
    tab (uncompressed size) : 4000 MB
    Seems it depends on how redefinition handles the move of the compressed data.
    So if redefinition uses INSERT /* APPEND */ .... is should be roundabout 1000 MB ("compress during write")
    Is this assumption correct ?
    Can anybody shed some light on redefinition wich kind of compression-conserving stragetgy it uses ?
    bye
    BB

    From the 11.2 admin guide:
    Create an empty interim table (in the same schema as the table to be redefined) with all of the desired logical and physical attributes. If columns are to be dropped, do not include them in the definition of the interim table. If a column is to be added, then add the column definition to the interim table. If a column is to be modified, create it in the interim table with the properties that you want.The table being redefined remains available for queries and DML during the entire process.
    Execute the FINISH_REDEF_TABLE procedure to complete the redefinition of the table. During this procedure, the original table is locked in exclusive mode for a very short time, independent of the amount of data in the original table. However, FINISH_REDEF_TABLE will wait for all pending DML to commit before completing the redefinition.>
    If you did not want to create an interim table, then this approach is not going to work for you. There is no requirement for you to create anything other than the interim table, and any dependent objects can be done automatically, including materialized views. Where did you see that you have to create mview logs?

  • [svn:bz-trunk] 22429: Adding the default fallback of serializer and deserializer classes to amf deserializer and amf serializer

    Revision: 22429
    Revision: 22429
    Author:   [email protected]
    Date:     2011-09-07 08:04:46 -0700 (Wed, 07 Sep 2011)
    Log Message:
    Adding the default fallback of serializer and deserializer classes to amf deserializer and amf serializer
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/io/SerializationContext.java

  • Why Does idvd take my 26.2gb imovie file and compress it so small?

    Please help. I've created a 17+ minute long imovie file that is 26.2gb. When I view the file information in idvd it says that it's only 0.6gb.
    I've already burned a test copy and it looked way too compressed. Like a bad jpg file. From idvd, I burned 'best quality' to a disc image and toasted it. I know that idvd decides who to do the compression in some complex way, but is there another method to not have so much compression?
    Thanks...

    Robert,
    DV (as normally exported from iMovie to iDVD) runs
    about 13 GB per hour. You say your content is 17
    minutes and 26.GB - what CODEC did you use?
    DVDs are in MPG-2 compressed format. In Best Quality
    mode iDVD will take 120 minutes of DV content and
    compress it to about 4 GB. So 17 minutes of content
    could be about .6 GB.
    F Shippey
    Thanks for your reply. I didn't pick a codec. I just clicked create idvd from imovie and it did it for me. I've made at least 10 other dvds and haven't seen this much loss of quality before. I'm just not sure why...
    0.6 was project size and I guess your math is right, but I've very disappointed with quality.
    Thanks,
    Bob

  • Relation between Rollup and compression.

    Hi All,
    Is there a relation between rollup and compression ? i.e if i compress the cube, will the rollup job be faster ?

    Hi,
    Thanks for all your replies. Now the picture is crystal clear.
    1. A compression job moves data from F table to E table. This is also applicable for aggregates. If you schedule a compression job for a cube, the aggregates are automatically compressed( You can also compress aggregates of a cube without compressing the cube. There are programs avalibale for the same).
    2. Assume that you have not done compression . If you load the data to base cube ,it takes more time to create the indexes after loading.
    3) Assume that you have done compression . If you load the data to base cube ,it takes less time than 2 point to create the indexes after loading.
    On similar lines, if aggregates of a cube  are compressed before rollup, then rollup will be faster. This is what exactly I have experienced. I had a cube which had 1000 request. It was never compressed. The rollup job for the cube used to take around 60,000 seconds. I compressed 900 requests. Now the rollup job gets over in 2400 seconds.So the conclusion is the following:
    <b>When aggregates of a cube are compressed, the rollup job runs faster.</b>
    Message was edited by: Tej Trivedi

  • Diff between Serialization and Synchronization

    Hi I am new to java.
    Pl. give me the difference between Serialization and Synchronization.
    Thankq
    Sridhar

    Don't you look at the timestamps of posts? They could
    have been typing at the same time.
    /KajPlease stop! I'll die laughing. LOL
    Re: Diff between Serialization and Synchronization
    Author: Annie.   Apr 11, 2005 10:30 AM (reply 1 of 4)  
    Re: Diff between Serialization and Synchronization
    Author: glrao   Apr 12, 2005 8:31 AM (reply 2 of 4) I really like your sense of humor.
    xH4x0r

  • Diff between Serialization and Synchonization

    Hi I am new to java.
    Pl. give me the difference between Serialization and Synchonization.
    Thankq
    Sridhar

    Pl. give me the difference between Serialization and
    Synchonization.Object serialization is the process of saving an object's state to a sequence of bytes, as well as the process of rebuilding those bytes into a live object at some future time. The Java Serialization API provides a standard mechanism for developers to handle object serialization.
    Synchronization is intended to make the code thread safe by setting locks on objects.
    They are totally different concepts. I fail to understand how you intend to compare them.

  • Sort and compress transport!

    Hi SDN,
    What is sort and compress of a transport!!

    Hi Radhakishan,
    Welcome to SDN!!
    There are many a times when you would include objects from a earlier transport request into your new transport request. Now you may also add the same object individually. This would make two entries for the same object in the same transport request. So you would use the "sort and compress" option to remove the redundancy and also have only the "latest" version.
    Bye
    Dinesh

  • Singleton serialization and weblogic - help!

    hi everyone,
    I'm trying to serialize a singleton cache object we're using for our (intranet)
    website running on weblogic 6.1. I've made sure the singleton class
    implements serializable, and i've also put the following method in the
    singleton class (ChartCache.java):
    private Object readResolve()
    return theInstance; //which is of type ChartCache
    By the way I'm using jdk 1.3. I've trawled the web and can't find anything to help me yet...
    Basically I've written a jsp to get the current instance of the cache
    and serialize it to a file. When I invoke another jsp i want it to
    reinflate the object and place it back into the weblogic jvm so it can
    once again be accessed as a singleton by all classes in the webapp. At
    the moment its just not working - the cache object will eventually
    take over half an hour to create (huge database processing going on)
    so I want the option, if weblogic falls over, to reinstantiate the
    cache without having to rebuild it from scratch. The cache will only
    be refreshed once a day.
    I'll c&p my jsp code below...
    ======================= restoreCache.jsp
    <%@ page import = "java.util.*" %>
    <%@ page import = "java.io.*" %>
    <%@ page import = "com.drkw.agencylending.website.chartcache.*" %>
    <%@ page import = "com.drkw.agencylending.log.Logger" %>
    <%
    ChartCache theCache = null;
    try
    String filename = "chartCache.dat";
    FileInputStream fis = new FileInputStream(filename);
    ObjectInputStream in = new ObjectInputStream(fis);
    theCache = (ChartCache)in.readObject();
    in.close();
    catch(Exception e)
    Logger.log(e);
    %>
    Resurrected chart cache from file.
    ======================= saveCache.jsp
    <%@ page import = "java.util.*" %>
    <%@ page import = "java.io.*" %>
    <%@ page import = "com.drkw.agencylending.website.chartcache.*" %>
    <%@ page import = "com.drkw.agencylending.log.Logger" %>
    <%
    ChartCache theCache = ChartCache.getInstance();
    String fileName = "chartCache.dat";
    try
    FileOutputStream fos = new FileOutputStream(fileName);
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(theCache);
    oos.flush();
    oos.close();
    catch(Exception e)
    Logger.log(e);
    %>
    Wrote cache object to file.
    ============================
    At the moment, a file is getting written but it seems suspiciously
    small (73 bytes!) for what is a very large object. When I try to load
    it up again, I get no errors but when I call ChartCache.getInstance()
    (my singleton) it recreates the cache rather than using the one I've
    reinflated. BTW I don't need to worry about server clustering/JNDI to
    ensure I have a truly singleton instance - there will only ever be one
    JVM to worry about.
    Any help greatly appreciated!

    solved the problem using another technique. Rather
    than serialize the entire singleton object, I just
    serialized the hashmap (the only bit I really care
    about). Then in the private constructor, the class
    checks a database flag to see whether the singleton
    was created today - if not, I refresh the cache,
    otherwise load in the serialized hashmap and set that
    as my class member. No complicated jndi/ejb registry
    needed to get around it..!singleton serialization is not recommended in ejb enviroment, it will cause problems. in what you are doing, it is far better to persist the data values in a database.
    just for the sake of writing a serializable sington: in addition to what you do in a regular object, you would first check to see if this obj has been serialized, if it is, deserialize it and return this one. you would have to write your own method to do serialization, making sure you have only one place to serialize it, and let the object know where the file is.

Maybe you are looking for

  • TNS-12535 Operation timed out

    Hi I am working on IBM AIX, Oracle 10.2.0.4 version. Here I got the TNS-12535 error while running a report at particular time. (i.e 8:30 PM to 10:00 PM PST). But aftter this particular time it runs good. There is no errors found in alert log file. Th

  • MDM 5.5 installed in Netweaver/Abap instance MCOD

    Since MDM 5.5 install guide does not include Oracle as part of the installation (the installation is not SAPINST based), I installed MDM servers connecting to a netweaver/Abap instance that got installed separately, so in this case my MDM installatio

  • OS X 10.5.8 Upgrade

    I am very new to the Mac world as our office has recently switched over from PCs. I have a MacBook Air OS X 10.5.8 with a 1.6GHz Intel Core 2 Duo. I need to upgrade to at least 10.6 Snow Leopard but do not have a CD drive.  Any advice?  Thanks!

  • Is my Mac an early or mid? Hdmi with audio?

    I am going to purchase a 17" MacBook Pro model FC665LL/A I want to know if I will be able to play both audio and video thru my hdmi output. It mentions it will work with models. If not what are my options?

  • InvalidCastException run an execution in WPF host

    i got this error when I ran the execution in my WPF host. An exception occurred inside of the call to .NET member 'CreateFromXmlFile': System.InvalidCastException: [A]TsDllCall.Person cannot be cast to [B]TsDllCall.Person. Type A originates from 'TsD