Performance of object deserialization

Hi :) I am serialising a (rather large) object graph. The resulting file is about 10 megabytes. The deserialization of this object graph takes about 6.5 seconds, which is a little long.
So my questions are these:
(1) Is there a way to improve the performance of object deserialization?
(2) Is object deserialization the way to go? Would I get better performance is I wrote the object to a binary file myself?
Thanks :)
Kind regards,
Ben

You can get better performance writing the object to a binary file yourself, yes.
In particular, if you keep the data in multiple files or a chunked RandomAccessFile, you can read in only the parts you need and speed up the process (assuming you don't need to read all the data in at once.)
But yeah. The overhead you get from reading/writing the serialised headers can add to the size of the file, and the time taken to read it back. Particularly if you know exactly what objects appear in the file, and what order they appear in.

Similar Messages

  • How to improve the performance of serialization/deserialization?

    Hi, Friends,
    I have a question about how to improve the performance of serialization/deserialization.
    When an object is serialized, the entire tree of objects rooted at the object is also serialized. When it is deserialized, the tree is reconstructed. For example, suppose a serializable Father object contains (a serializable field of) an array of Child objects. When a Father object is serialized, so is the array of Child objects.
    For the sake of performance consideration, when I need to deserialize a Father object, I don't want to deserialize any Child object. However, I should be able to know that Father object has children. I should also be able to deserialize any child of that Father object when necessary.
    Could you tell me how to achieve the above idea?
    Thanks.
    Youbin

    You could try something like this...
    import java.io.*;
    import java.util.*;
    class Child implements Serializable {
        int id;
        Child(int _id) { id=_id; }
        public String toString() { return String.valueOf(id); }
    class Father implements Serializable
        Child[] children = new Child[10];
        public Father() {
         Arrays.fill(children, new Child(1001));
        public void readObject(ObjectInputStream stream)
         throws IOException, ClassNotFoundException
         int numchildren = stream.readInt();
         for(int i=0; i<numchildren; i++)
             children[i] = (Child)stream.readObject();
         stream.close();
        public void writeObject(ObjectOutputStream stream) throws IOException
         stream.writeInt(children.length);
         for(int i=0; i<children.length; i++)
             stream.writeObject(children);
         stream.close();
    Child[] getChildren() { return children; }
    class FatherProxy
    int numchildren;
    String filename;
    public FatherProxy(String _filename) throws IOException
         filename = _filename;
         ObjectInputStream ois =
         new ObjectInputStream(new FileInputStream(filename));
         numchildren = ois.readInt();
         ois.close();
    int getNumChildren() { return numchildren; }
    Child[] getChildren() throws IOException, ClassNotFoundException
         ObjectInputStream ois =
         new ObjectInputStream(new FileInputStream(filename));
         Father f = (Father)ois.readObject();
         ois.close();     
         return f.getChildren();
    public class fatherref
    public static void main(String[] args) throws Exception
         // create the serialized file
         Father f = new Father();
         ObjectOutputStream oos =
         new ObjectOutputStream(new FileOutputStream("father.ser"));
         oos.writeObject(f);
         oos.close();
         // read in just what is needed -- numchildren
         FatherProxy fp = new FatherProxy("father.ser");
         System.out.println("numchildren: " + fp.getNumChildren());
         // do some processing
         // you need the rest -- children
         Child[] c = fp.getChildren();
         System.out.println("children:");
         for(int i=0; i<c.length; i++)
         System.out.println("i " + i + ": " + c[i]);

  • Some performance counter objects are not available for a 32-bit process on 64-bit versions of Windows Server 2012 standard

    When we try to gather performance counter information for a 32-bit process on a 64-bit computer that is running Microsoft Windows Server 2012, all our performance counter objects are not available with 32 bit perfmon application (C:\Windows\SysWOW64\perfmon.exe)
    I didn't notified any errors while registering our counter objects or while running Perfmon.exe
    Note: Same counter objects are available and working fine with Windows Server 2008 R2.
    for diagnostic our counters on WIN2012, ran command as follows:
     cd c:\windows\sysWOW64
     lodctr /Q
    I am able to see all our counter objects on response and infact all were shown as enabled, as shown below
    Appreciate quiclk response with solution or clues to diagnose it more details.
    Thanks & Regards,
    Sudhakar Rudra

    Hi,
    Thanks for your reply.
    I hope you understood our problem.
    same our system counter objects (ver x), we able to browse from Perfmon 32 bit app on Windows 7, Windows 2008 R2 (64bit) OS but not on Windows 2012.
    I am able to see all counter objects registered as follows (same at HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\HMI Alarm Class\Performance,
    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\HMI Alarm Class\Performance
    and
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HMI Alarm Class\Performance)
    Only difference I observed that "Disable Performance Counters" were set to 4 in Windows 2012 OS unlike other windows 7 64bit OS and there is no differnece for remaining all entires.
    I tried setting that "Disable Performance Counters" value to "0", but some how they get reset to "4", no luck..
    I think "Disable Performance Counters" value either "0", or "4", should not matter for browsing our counters with 32bit bit perfmon applicaiton.
    Do you see any issues of registry entries. ?
    On what basis perfomance monitor list few enabled counters?
    How can we add our counters manually to perfomance monitor?

  • Performance Management Objective Setting

    Hi Everyone,
    I am working on a full HCM implementation and had a few questions regarding performance management.  The client is interested in having goals and objectives "cascade" through org. units and pre-load on Performance Appraisal templates.
    In the phap_catalog, I have noticed a value determination named "ORG_OBJECTIVES" and it supposedly auto-fills goals set by managers for the performance review period.
    Basically, I am looking for a productive/proper way to have goals flow from the overall organization, through lower level organizational units down to each and every employee.
    For example: Company X has 3 overall goals -> Bob Smith works within Org. Unit Y in which there are 3 separate goals that refer to this Org. Unit -> and then Bob Smith has the ability to add 3 of his own goals for the year.  Overall there would be 3 overall company goals, 3 org. unit goals (total of 6 that pre-fill) and 3 empty fields for Bob Smith to input his own goals.
    Any help would be wonderful.  Thank you for your time.

    Raghu,
    Your response was extremely helpful.
    Do you have any documentation or guidance on how I could create custom tables to use this BADI that you are talking about.  Currently there is no plan for SEM, so I am going to have to take the route of custom tables utilizing the BADI that you mentioned.  In terms of custom tables, creating them and using them, I only have a high level knowledge, so any documentation/guidance would be very helpful.
    Regards,
    Adam P.

  • Object Deserialization help?

    Hi all,
    Once again I am forced to offer up my programming efforts for professional advice. :) I'm doing object serialization / deserialization. I have a very simple class called Person which looks like this: -
    public class Person implements Serializable {
        private String sName;
        private String sAddress;
        public Person(String sName, String sAddress) {
            this.sName = sName;
            this.sAddress = sAddress;
        public String toString() {
            return sName + " lives at: " + sAddress;
    }All this does is store a name and address String for the object and return it via its toString() method. All well and good. I've made sure it implements the Serializable interface too.
    The following program asks for as many names and addresses as you like (until you type 'exit' as a name) and creates a Person instance from this. It then outputs the data from the object and creates ObjectOutputStream (set to append) to the file and writes the Person instance to the file. It then resets and closes the file.
    This happens for each Person object instance you create. After you've typed 'exit', you are given the option to read back the data from the file you created. This always gives me a "StreamCorruptedException" at this line: -
    aPerson = (Person)objectIn.readObject();My book states that "...this is thrown when objects are written to the stream. When the object is written to the output stream, additional control data is written so that the object data can be validated when it is read back. This exception is thrown when the control information in the stream is inconsistent."
    ....which doesn't really help me track down why its happening. :)
    Anyway, here is the code for the main program.....sorry its a little on the long side, but its mostly println()'s anyway. :) Don't worry about the Input class, thats just my encapsulated BufferedReader class.
    import java.io.*;
    public class PersonTest {
        public static void main(String[] args) {
            Input keyboard = new Input();
            final String sFilePath = "C:/Beg Java Stuff/PersonObjects.bin";
            Person aPerson = null;
            String nameInput = new String();
            String addressInput = new String();
            ObjectOutputStream objectOut = null;
            ObjectInputStream objectIn = null;
            String sAnswer = null;
            int iCount = 0;
            System.out.println("Program started\n");
            while (!nameInput.equals("exit")) {
                System.out.print("Enter Person name: ");
                nameInput = keyboard.readString();
                if (!nameInput.equals("exit")) {
                    System.out.print("Enter Person address: ");
                    addressInput = keyboard.readString();
                    aPerson = new Person(nameInput, addressInput);
                    System.out.println("Person object created.");
                    System.out.println("Person data: " + aPerson);
                    try {
                        objectOut = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(sFilePath, true)));
                        objectOut.writeObject(aPerson);
                        objectOut.reset();
                        objectOut.close();
                        System.out.println("Person object successfully written to file.");
                    } catch (IOException e) {
                        System.out.println("Could not add Person object to file.");
                        e.printStackTrace(System.err);
                        System.exit(1);
            System.out.println("Do you want to list the contents of the file (Y/N)?");
            sAnswer = keyboard.readString();
            if (sAnswer.toUpperCase().equals("Y")) {
                System.out.println("Attempting to load Person file...");
                try {
                    objectIn = new ObjectInputStream(new BufferedInputStream(new FileInputStream(sFilePath)));
                    while(true) {
                        aPerson = (Person)objectIn.readObject();
                        iCount++;
                        System.out.println(aPerson);
                } catch (ClassNotFoundException e) {
                    System.out.println("Could not load Person file.");
                    e.printStackTrace(System.err);
                    System.exit(1);
                } catch (EOFException e) {
                    System.out.println("Finished loading Person file. Loaded " + iCount + " Person object(s).");
                } catch (IOException e) {
                    System.out.println("Could not load Person file.");
                    e.printStackTrace(System.err);
                    System.exit(1);
                try {
                    objectIn.close();
                } catch (IOException e) {
                    System.out.println("Failed to close Person file properly.");
                    e.printStackTrace(System.err);
                    System.exit(1);
            System.out.println("\nProgram ended\n");
            System.exit(0);
    }Many thanks to anyone who can shed light on this. Mucho (well......seven) Duke Dollars for the clever yet compassionate coder who can help me out :)
    Thanks.

    Odd, making that change doesn't alter the output or prevent the exception for me (using 1.4.1 on NT4).
    The reason there is an error is that the file contains repeated class header information.
    Reset is used to force the header information for the subsequent objects to be written. Not calling reset will not change the output in this case, as nothing is written after reset is called.
    It is better to write each object to the file, then close it once, eg:    objectOut = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(sFilePath)));
        while (true) {
          System.out.print("Enter Person name: ");
          nameInput = keyboard.readLine();
          boolean validName = (!nameInput.equals("exit"));
          objectOut.writeBoolean(validName);
          if (validName) {
            System.out.print("Enter Person address: ");
            addressInput = keyboard.readLine();
            aPerson = new Person(nameInput, addressInput);
            System.out.println("Person object created.");
            System.out.println("Person data: " + aPerson);
            try {
              objectOut.writeObject(aPerson);
              System.out.println("Person object successfully written to file.");
            } catch (IOException e) {
              System.out.println("Could not add Person object to file.");
              e.printStackTrace(System.err);
              System.exit(1);
          } else {
            break;
        objectOut.close();
        System.out.println("Do you want to list the contents of the file (Y/N)?");
        sAnswer = keyboard.readLine();
        if (sAnswer.toUpperCase().equals("Y")) {
          System.out.println("Attempting to load Person file...");
          try {
            objectIn = new ObjectInputStream(new BufferedInputStream(new FileInputStream(sFilePath)));
            while(objectIn.readBoolean()) {
              aPerson = (Person)objectIn.readObject();
              iCount++;
              System.out.println(aPerson);
            System.out.println("Finished loading Person file. Loaded " + iCount + " Person object(s).");
          } catch (ClassNotFoundException e) {
            System.out.println("Could not load Person file.");
            e.printStackTrace(System.err);
            System.exit(1);
          } catch (EOFException e) {
            System.out.println("Unexpected end of file-data corrupt.");
            e.printStackTrace(System.err);
            System.exit(1);
          } catch (IOException e) {
            System.out.println("Could not load Person file.");
            e.printStackTrace(System.err);
            System.exit(1);
          }It's generally a bad idea to use exceptions for normal program control flow- I've added a boolean continuation marker instead.
    Pete

  • Data service complex object deserialization

    I am building a simple data services application that has a
    many-to-one association between two classes:
    public class Product {
    public var title : String;
    public class LineItem {
    public var product : Product
    public get function title() : String { return
    this.product.title; }
    I am trying to populate a DataGrid with a list of LineItems,
    using the product's title in one of the fields. It seems, however,
    that the LineItem product property is populated with an Object, not
    a Product when returning from the DataService call. From I have
    read (see #9), this
    seems to be expected based on how the Flash player deserializes
    data.
    My question though is if there is an easy work around for
    this problem? Thus far, all I have found that works is to access a
    LineItem from the DataService result after it completes, but that
    seems very hack-ish to me.
    Thanks,
    Josh

    The InputRender is the recommended tag for complex types. The only problem is that it doesn't (currently) support object types. It supports interMedia types. You need to use the ShowValue tag and the SetAttribute tag in order to update your complex type. In our next release we will add object support to the InputRender tag.
    Thanks
    null

  • Performance Management Objectives are stored Table?

    Hi Friends,
    When i click on Add Objective using Performance Management page i.e the SSHR page
    I am getting the following fields:
    Objective Name
    Created By
    Start Date
    Target Date
    Next Review Date
    Group (Has a list of departments)
    Priority
    Weighting Scale
    Complete (%)
    Achievement Date
    I would like to know if these fields are stored in which table immediately.
    but after transfer the objects to manager, the manager Review worker changes then PER_OBJECTIVES table populated.
    but i want to before which table these objective are stored.
    Please help

    Hi avajain,
    per_performance_tatings fine.
    but i want to objective status informantion.
    means manager created objective send to employee that time status is WKR, Then employee changes and send to manger that time status APPROVAL like way..
    these objective status which table stored.
    can u help me any body
    thanks and regards
    rkrao.

  • [SQLDev1.1] Poor performance in Object Navigator

    I have downloaded the new SQLDeveloper 1.1 and am exited about the new features (mainly time display).
    However it looks to be unusable for me as I can't list any of my tables in the Object Navigator in my main database (ERP system). When I want to expand my tables branch I just get the "Loading tables" display that does not go away. I do not have that many tables in this schema and would like to be able to see them all. But for some reason it just will not work.
    I have had some success with other databases but the performance was a lot less than v1.0. Is there anything I can do to improve this performance?
    Edit: It looks like there is some form of "critical mass". If the number of tables to retrieve is higher than a certain number the performance takes a dive. I still haven't been able to get a full list.
    Message was edited by:
    Deddiekoel

    This is classic manifestation of the law of diminishing return. Having the table synonyms listed, and show partition information conditionally, and not to have materialized view tables listed is a small increment in the navigator table node. IMO, those features are not worth of drastic performance degradation.
    If you don't want to wait for 1.1.1 patch, modify the queries in table.xml as folows:
    <query minversion="10">
    <sql constrained="false">
    <![CDATA[
    select --+ rule
    * from (
    SELECT OBJECT_NAME, OBJECT_ID ,'' short_name, 'TRUE' partition, OWNER OBJECT_OWNER
    FROM SYS.ALL_OBJECTS O WHERE O.OWNER = :SCHEMA AND O.OBJECT_TYPE = 'TABLE' AND O.GENERATED = 'N'
    AND O.OBJECT_ID NOT IN ( SELECT PURGE_OBJECT FROM RECYCLEBIN )
    )]]>
    </sql>
    </query>
    <query minversion="9">
    <sql constrained="false">
    <![CDATA[
    select -- rule
    * from (
    SELECT OBJECT_NAME, OBJECT_ID ,'' short_name, 'TRUE' partition, OWNER OBJECT_OWNER
    FROM SYS.ALL_OBJECTS O WHERE O.OWNER = :SCHEMA AND O.OBJECT_TYPE = 'TABLE' AND O.GENERATED = 'N'
    ) ]]>
    </sql>
    </query>
    These queries run 0.5-0.7 sec on Apps Vision database, so the table node refresh is under 2 sec.
    (I'll also look up into the other nodes performance, but don't hesitate to bring it up in the forum).

  • Object deserialization and specific classloaders

    Hi,
    I must load jars during the runtime in a specific classloaders, it's works, but how could i use this class loader to deserialize object i receive from wire ? is it possible to include my specific classloader in the search tree of the main classloader ?
    thanks in advance.
    Francois

    871637 wrote:
    how could i use this class loader to deserialize object i receive from wire ?You don't. You use a classloader to load a class.
    is it possible to include my specific classloader in the search tree of the main classloader ?No. If you want your classloader to load a class, you have to make sure that class is not on the classpath, else it will be loaded by the system classloader.

  • Performance Management/Objective setting and Appraisals - To Hide elements

    Hi All,
    In PMS/Objective setting and Appraisals module, is there any BADI available to Hide elements( Criteria & Criteria group) on Sub status wise. Meaning, suppose i have Substatus A, B, C & D in status "2" ( In planning) and one of the VC element should be hidden in Status = 2 & substatus = A, B. But in "C" & "D" sub stauts it should be visible.
    If BADI is not available then is there any possible way out for the same.
    Thanks,
    Ashwini.

    There is no badi for this, it slipped of radar during the development of the hide element functionality.
    The only why to achieve the same would be by having a customer own UI and control it on UI level, but its an ugly way which I do not recommend.
    Regards and Groetjes,
    Maurice Hagen

  • Disappointing query performance with object-relational storag

    Hello,
    after some frustrating days trying to improve query performance on an xmltype table I'm on my wits' end. I have tried all possible combinations of indexes, added scopes, tried out of line and inline storage, removed recursive type definition from the schema, tried the examples from the form thread Setting Attribute SQLInline to false for Out-of-Line Storage (having the same problems) and still have no clue. I have prepared a stripped down example of my schema which shows the same problems as the real one. I'm using 10.2.0.4.0:
    SQL> select * from v$version;
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    You can find the script on http://www.grmblfrz.de/xmldbproblem.sql (I tried including it here but got an internal server error) The results are on http://www.grmblfrz.de/xmldbtest.lst . I have no idea how to improve the performance (and if even with this simple schema query rewrite does not work, how can oracle xmldb be feasible for more complex structures?). I must have made a mistake somewhere, hopefully someone can spot it.
    Thanks in advance.
    --Swen
    Edited by: user636644 on Aug 30, 2008 3:55 PM
    Edited by: user636644 on Aug 30, 2008 4:12 PM

    Marc,
    thanks, I did not know that it is possible to use "varray store as table" for the reference tables. I have tried your example. I can create the nested table, the scope and the indexes, but I get a different result - full table scan on t_element. With the original table I get an index scan. On the original table there is a trigger (t_element$xd) which is missing on the new table. I have tried the same with an xmltype table (drop table t_element; create table t_element of xmltype ...) with the same result. My script ... is on [google groups|http://groups.google.com/group/oracle-xmldb-temporary-group/browse_thread/thread/f30c3cf0f3dbcafc] (internal server error while trying to include it here). Here is the plan of the query
    select rt.object_value
    from t_element rt
    where existsnode(rt.object_value,'/mddbelement/group[attribute[@name="an27"]="99"]') = 1;
    Execution Plan
    Plan hash value: 4104484998
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 40 | 2505 (1)| 00:00:38 |
    | 1 | TABLE ACCESS BY INDEX ROWID | NT_GROUP | 1 | 20 | 3 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | SYS_C0082879 | 1 | | 2 (0)| 00:00:01 |
    |* 3 | FILTER | | | | | |
    | 4 | TABLE ACCESS FULL | T_ELEMENT | 1000 | 40000 | 4 (0)| 00:00:01 |
    | 5 | NESTED LOOPS SEMI | | 1 | 88 | 5 (0)| 00:00:01 |
    | 6 | NESTED LOOPS | | 1 | 59 | 4 (0)| 00:00:01 |
    | 7 | TABLE ACCESS BY INDEX ROWID| NT_GROUP | 1 | 20 | 3 (0)| 00:00:01 |
    |* 8 | INDEX RANGE SCAN | SYS_C0082879 | 1 | | 2 (0)| 00:00:01 |
    |* 9 | TABLE ACCESS BY INDEX ROWID| T_GROUP | 1 | 39 | 1 (0)| 00:00:01 |
    |* 10 | INDEX UNIQUE SCAN | SYS_C0082878 | 1 | | 0 (0)| 00:00:01 |
    |* 11 | INDEX RANGE SCAN | SYS_IOT_TOP_184789 | 1 | 29 | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("NESTED_TABLE_ID"=:B1)
    3 - filter( EXISTS (SELECT /*+ ???)
    8 - access("NESTED_TABLE_ID"=:B1)
    9 - filter("T_GROUP"."SYS_NC0001300014$" IS NOT NULL AND
    SYS_CHECKACL("ACLOID","OWNERID",xmltype('<privilege
    xmlns="http://xmlns.oracle.com/xdb/acl.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-insta
    nce" xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
    http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-properties
    /><read-contents/></privilege>'))=1)
    10 - access("SYS_ALIAS_3"."COLUMN_VALUE"="T_GROUP"."SYS_NC_OID$")
    11 - access("NESTED_TABLE_ID"="T_GROUP"."SYS_NC0001300014$")
    filter("SYS_XDBBODY$"='99' AND "NAME"='an27')
    Edited by: user636644 on Sep 1, 2008 9:56 PM

  • Object deserialization problems?

    A bit of a crosspost perhaps but not really sure if new to java or java programming is really the right place..anyway..i have a resultset containing object serializations..in the code below rs is a ResultSet;
    while(rs.next()){
           ObjectInputStream in = new ObjectInputStream(rs.getBinaryStream(1));
           productionRule rule = (productionRule)in.readObject();
           answer.add(rule);
         }this works on the first time round and returns the properly deserialized object in rule..which is then added to the LinkedList answer but on the second iteration the line;
           ObjectInputStream in = new ObjectInputStream(rs.getBinaryStream(1));produces an IOException with a getMessage() of Invalid Stream header
    I have no idea why this is occurring..does any one have any idea?

    The ResultSet.getBinaryStream() says the following
    Note: All the data in the returned stream must be read prior to getting the value of any other column. The next call to a getXXX method implicitly closes the stream. Also, a stream may return 0 when the method InputStream.available is called whether there is data available or not.
    Maybe, when you leave the first row, it is closing down the inputstream on the second row before you can read it ? Strange... but fits the symptoms.
    Could it be, that the inputstream you receive is valid for the entire resultset ? Ie. you can read multiple objects from one getBinaryStream() call on a resultset, outside of your while loop ???
    regards,
    Owen

  • Object performance,need detail of Oracle's internal performance testing

    hi Geoff,
    from your previous answer:
    From an Oracle's comprehensive internal performance testing,
    object implementation of an application consistently matches
    those of relational implementation.
    For some operations, using objects performed better. can you tell more about the result of the testing ?
    we need to get the comparison between the two implementation,
    in order to know in which case should use object implementation
    and in which case should not.
    thanks
    Ray

    Ray,
    Before I name some cases that objects perform better, I still
    want to emphasize that your application object model comes
    first. Here are the cases:
    1. If you have nested objects (e.g., customer with address
    attribute), querying the nested objects would work faster than
    relational access.
    2. If you have containment objects (e.g., customer with VARRAY
    of phone numbers), querying these contained objects would also
    work faster than relational.
    What is your application? What does your object model look like?
    The more specific your question is, the better I can answer it.
    Regards,
    Geoff
    hi Geoff,
    from your previous answer:
    From an Oracle's comprehensive internal performance testing,
    object implementation of an application consistently matches
    those of relational implementation.
    For some operations, using objects performed better. can you tell more about the result of the testing ?
    we need to get the comparison between the two implementation,
    in order to know in which case should use object implementation
    and in which case should not.
    thanks
    Ray

  • JMS getObject() Error deserializing object for client

    I am using WL6.1 and having a problem deserializing an object for a
              client that doesn't have access to the corresponding implementation
              object in its CLASSPATH (it only deals with the interface). From
              previous posts, I read that upgrading to SP3 would fix this issue, but
              I am still having this problem on both Solaris and Windows using SP3.
              If I modify the client CLASSPATH to include the Server-side JAR file
              that contains the implementation class, I don't have the problem and I
              can successfully perform getObject() and deserialize the object. The
              following is the code for the client:
              public void onMessage(Message msg)
              String msgText;
              if(msg instanceof ObjectMessage)
              try
              ObjectMessage objMsg = (ObjectMessage) msg;
              ActivityCreationEvent msgEvent =
              (ActivityCreationEvent) objMsg.getObject();
              System.out.println("Got a creation event");
              catch(Exception ex)
              System.out.println("Error getting JMS message:" + ex);
              ex.printStackTrace();
              the following is the code for the server:
              objMsg = tSess.createObjectMessage(null);
              ActivityCreationEvent createEvent=new ActivityCreationEventImpl();
              objMsg.setObject(createEvent);
              tPublisher.publish(objMsg);
              and the following is the client stack trace:
              Error getting JMS message:weblogic.jms.common.JMSException: Error
              deserializing object
              weblogic.jms.common.JMSException: Error deserializing object
              at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:141)
              at com.test.producer.tck.CreateProducerByValue.onMessage(CreateProducerByValue.java:566)
              at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1865)
              at weblogic.jms.client.JMSSession.execute(JMSSession.java:1819)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.Kernel.execute(Kernel.java:257)
              at weblogic.kernel.Kernel.execute(Kernel.java:269)
              ----------- Linked Exception -----------
              at weblogic.jms.client.JMSSession.pushMessage(JMSSession.java:1733)
              at weblogic.jms.client.JMSSession.invoke(JMSSession.java:2075)
              at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:510)
              at weblogic.jms.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:149)
              at weblogic.jms.dispatcher.DispatcherImpl.dispatchOneWay(DispatcherImpl.java:429)
              at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              java.lang.ClassNotFoundException:
              com.test.activity.ri.ActivityCreationEventImpl
              at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:190)
              at weblogic.jms.common.ObjectMessageImpl$ObjectInputStream2.resolveClass(ObjectMessageImpl.java:277)
              at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:913)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
              at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1181)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
              at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:127)
              at com.test.producer.tck.CreateProducerByValue.onMessage(CreateProducerByValue.java:566)
              at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1865)
              at weblogic.jms.client.JMSSession.execute(JMSSession.java:1819)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.Kernel.execute(Kernel.java:257)
              at weblogic.kernel.Kernel.execute(Kernel.java:269)
              at weblogic.jms.client.JMSSession.pushMessage(JMSSession.java:1733)
              at weblogic.jms.client.JMSSession.invoke(JMSSession.java:2075)
              at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:510)
              at weblogic.jms.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:149)
              at weblogic.jms.dispatcher.DispatcherImpl.dispatchOneWay(DispatcherImpl.java:429)
              at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              The client doesn't need to have access to the implementation class for
              any other aspect of the code, and I would like to keep it that way.
              Does anyone have information as to the cause of the problem and a
              solution?
              Thanks in advance
              

    Hi James,
              Just having the interface is not sufficient, as the JVM must be able to
              find the implementation class of an object in order to unserialize it - this is not a WebLogic
              thing, it is a java thing. Either package the required class in the .ear that contains
              the MDB or put it in your classpath.
              Tom
              James J wrote:
              > I am using WL6.1 and having a problem deserializing an object for a
              > client that doesn't have access to the corresponding implementation
              > object in its CLASSPATH (it only deals with the interface). From
              > previous posts, I read that upgrading to SP3 would fix this issue, but
              > I am still having this problem on both Solaris and Windows using SP3.
              > If I modify the client CLASSPATH to include the Server-side JAR file
              > that contains the implementation class, I don't have the problem and I
              > can successfully perform getObject() and deserialize the object. The
              > following is the code for the client:
              >
              > public void onMessage(Message msg)
              > {
              > String msgText;
              >
              > if(msg instanceof ObjectMessage)
              > {
              > try
              > {
              > ObjectMessage objMsg = (ObjectMessage) msg;
              > ActivityCreationEvent msgEvent =
              > (ActivityCreationEvent) objMsg.getObject();
              > System.out.println("Got a creation event");
              > }
              > catch(Exception ex)
              > {
              > System.out.println("Error getting JMS message:" + ex);
              > ex.printStackTrace();
              > }
              > }
              > }
              >
              > the following is the code for the server:
              >
              > objMsg = tSess.createObjectMessage(null);
              > ActivityCreationEvent createEvent=new ActivityCreationEventImpl();
              > objMsg.setObject(createEvent);
              > tPublisher.publish(objMsg);
              >
              > and the following is the client stack trace:
              >
              > Error getting JMS message:weblogic.jms.common.JMSException: Error
              > deserializing object
              > weblogic.jms.common.JMSException: Error deserializing object
              > at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:141)
              > at com.test.producer.tck.CreateProducerByValue.onMessage(CreateProducerByValue.java:566)
              > at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1865)
              > at weblogic.jms.client.JMSSession.execute(JMSSession.java:1819)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.Kernel.execute(Kernel.java:257)
              > at weblogic.kernel.Kernel.execute(Kernel.java:269)
              > ----------- Linked Exception -----------
              > at weblogic.jms.client.JMSSession.pushMessage(JMSSession.java:1733)
              > at weblogic.jms.client.JMSSession.invoke(JMSSession.java:2075)
              > at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:510)
              > at weblogic.jms.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:149)
              > at weblogic.jms.dispatcher.DispatcherImpl.dispatchOneWay(DispatcherImpl.java:429)
              > at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown
              > Source)
              > at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              > at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              > at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              > java.lang.ClassNotFoundException:
              > com.test.activity.ri.ActivityCreationEventImpl
              > at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
              > at java.security.AccessController.doPrivileged(Native Method)
              > at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
              > at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
              > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:281)
              > at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
              > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)
              > at java.lang.Class.forName0(Native Method)
              > at java.lang.Class.forName(Class.java:190)
              > at weblogic.jms.common.ObjectMessageImpl$ObjectInputStream2.resolveClass(ObjectMessageImpl.java:277)
              > at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:913)
              > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:361)
              > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
              > at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1181)
              > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
              > at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
              > at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.java:127)
              > at com.test.producer.tck.CreateProducerByValue.onMessage(CreateProducerByValue.java:566)
              > at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:1865)
              > at weblogic.jms.client.JMSSession.execute(JMSSession.java:1819)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.Kernel.execute(Kernel.java:257)
              > at weblogic.kernel.Kernel.execute(Kernel.java:269)
              > at weblogic.jms.client.JMSSession.pushMessage(JMSSession.java:1733)
              > at weblogic.jms.client.JMSSession.invoke(JMSSession.java:2075)
              > at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:510)
              > at weblogic.jms.dispatcher.DispatcherImpl.dispatchAsync(DispatcherImpl.java:149)
              > at weblogic.jms.dispatcher.DispatcherImpl.dispatchOneWay(DispatcherImpl.java:429)
              > at weblogic.jms.dispatcher.DispatcherImpl_WLSkel.invoke(Unknown
              > Source)
              > at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
              > at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
              > at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              > The client doesn't need to have access to the implementation class for
              > any other aspect of the code, and I would like to keep it that way.
              > Does anyone have information as to the cause of the problem and a
              > solution?
              >
              > Thanks in advance
              

  • How to instanciate/restore an object in the target JVM

    Hi,
    For the needs of a runtime project, I'd like to be able to interrupt the main method of my target VM as it starts (that, I can do), and call a static method that takes an object as parameter. At this point, obviously, the argument object is not defined, so I'd like to instanciate it from my runtime program (debugger). I don't know how to do that. I thought I could use the ClassType.newInstance() method, but the class I want to instanciate is not loaded yet, so I don't know how to get the right ClassType object.
    Actually what I'd like to do in the end is to be able to recreate an object (deserialize) to the target VM, so what I'm really looking for is a way of setting an entire object without having to invoke its constructor method. Does the redefineClass() method help here ? I'm not sure...
    Does someone knows a way of doing this ?
    Thanks

    Hi Tatayya,
    so I understand you right, that you want to launch a JSP from a different PAR file? You could do the following in this case.
    Create an additional JSP in the (first) PAR that simply does a redirect to the second iView (form the other PAR). In the contoller class of your first PAR, perform a this.setJspName("redirectMe.jsp").
    If you want to keep displaying the original JSP in the iView and simply display an additional popup, you could try:
    don't change the this.setJspName() (i.e. set it to the original page)
    Use a bean that stores a value like "showPopup yes/no"
    Query the bean in the JSP and render some javascript:window.open() code if "showPopup=true".
    Hope that helps,
    Dominik

Maybe you are looking for