Disadvantages of Using Externalizable

I know the advantages of using Externalizable.
But Iam trying to figure out if it is useful especially in my case.
I have an object which has other objects within and that object has some more objects, kind of like many-to-one relationsip.
I have been constantly getting java.io.EOFException, when de-serializing. I figured that the reason for that is that Iam putting some null values in my writeExternal method and when de-serializing readExternal spits out java.io.EOFException, coz it reaches end of stream.
That makes me to believe I have to be very careful what I put in output stream before I serialize. This is what I want to know.
Is it advisable to use Externalizable in this kind of situation?
I think Externalizable is a good choice for a class which does not contain many other objects, or whose behaviour is predictable. Agree?
Are there any dis-advantages of Externalizable?
(I could not find one post anywhere on the web about any disadvantages for Externalizable.....:-\ , cant believe if this is so good)
Thanks
gujja

if you change the order variables are declared in
your class, the default serialization will change the
order it expects to see the data during
serialization.Untrue.
And also change the order it writes
variables out during serialization.True but irrelevant. Fields are written out as name-value pairs so the ordering is immaterial.
If you implement your own methods, you can change
order of declaration and it will not break your
serialization. This only works if when you implement
your own, you do not call defaultWriteObject and
defaultReadObject.Also untrue. The ways in which you can change your class compatibly are completely defined in the Serialization specification: http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/version.html#6678. They include not only changing the order of fields but also adding them.

Similar Messages

  • What is the disadvantages of using Serialization?

    HAi all,
    I want to store objects in a file. I am preferred to use serialization. But I want to know what are the disadvantages of using Serialization over other methods (direct file, Keyed File)?
    Can we store as many records using serialization? Is there any limit? Is there any security related issues?
    Pls help me.
    regards,
    namanc

    I don't think there is disadvantage using serialization compare to direct i/o access to file or any storage, except that you need to design your code such as it is serializable (hence, you may want to use transient keyword, or use externalizable, to be able to store/load the object properly).
    Use serialization if possible, it saves you from inventing new+uncompatible mechanism of doing something in java.

  • Disadvantages of using "0" zero as first value in a generated sequence

    Does anyone have any experience with the benefits/disadvantages of using a value of 0 "zero" as the first value generated in a sequence that is also populated in a table. My past experience has always used the values of 1 "one" as the first generated value from a sequence.
    Thanks

    Benefit: You get use one "more" number from the list of values that can possibly be generated by the sequence. If you are start from '1', you have missed out on '0' :-)
    Disadvantages: If any of the queries have predicate like "sequence_generated_column_value > 0" and that your sequence starts from zero, the record with sequence_generated_column_value=0 will not appear in result set for that query (assuming it satisfies other conditions).
    May be there are many mores benefits/disadvantages to add to this list :-)

  • What are the drawbacks or disadvantages of using LSMW

    Hi All,
    Can anyone tell me what could be the possible disadvantages of using LSMW and also some disadvantages of BAPI.
    Regards,
    MD.

    Hi MD.
    I would like to suggest a couple of disadvantages of LSMW.
    Here are a few scenarios------>
    1. Time consumption -
    > IDOC processing plays a vital role.  The changes made to the IDOC is therefore very time consuming.
    2. In term of BAPI -
    > Incomplete in terms of input fields of a particular transaction, rather it is not always complete.
    3. In terms of Direct Input -
    > No enjoy transactions and incomplete in terms of input fields of a particular transaction.
    4. In terms of Batch input -
    > Slow in terms of new recordings to be done, but BDCs are much simpler in that terms.
    This factor also depends upon the user settings, The kind of processing which is foreground and background.
    Hope that's usefull.
    Good Luck & Regards.
    Harsh Dave

  • What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it

    hi,
    What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?
    regards.

    sorry, question resolved.

  • What are some of the advantages/disadvantage of using FC or FCoE with a storage array (EMC)? What is Cisco's recommendation and why?

                       What are some of the advantages/disadvantages of using FC or FCoE for a storage array? What does Cisco recommend?

    This is what I'm considering:
    Power:
    1050W Seasonic 80PLUS Gold Power Supply
    Motherboard:
    ASUS, Rampage IV Extreme, 2011, SATA6, True Quad SLI/XFIRE, Extreme OC Capable
    CPU:
    Intel Core i7-4960X 3.60GHz, 2133MHz DDR3, 15MB Cache, Hex Core Processor
    System Memory:
    16GB (4 x 4GB) , PC3-19200, 2400MHz (G.Skill - x79)
    Video Adapter 1:
    NVIDIA GeForce GTX 780ti 3GB GDDR5
    Video Adapter 2:
    None
    Optical 1
    16X Blu-ray Burner - 16xBD-R, 2xBD-RW/16xDVD-R, 8xDVD-RW/48xCD-R, 24xCD-RW
    Bay Accessories 1
    NZXT Aperture M Multi-media Hub
    RAID [Requires Identical Hard Drive Selections]
    RAID 0 | 2 Disk Min. Striped set, improved performance, additional storage drive highly recommended
    Hard Drive 1
    Crucial M550 1TB 2.5" SATA III 6GB/sec Solid State Drive
    Hard Drive 2
    Crucial M550 1TB 2.5" SATA III 6GB/sec Solid State Drive
    Hard Drive 3
    Crucial M550 1TB 2.5" SATA III 6GB/sec Solid State Drive
    Sound Card
    Creative Labs Sound Blaster Z PCI Express

  • What's disadvantages when using bind variables always in java?

    Hello everyone .. Could someone tell me what's the disadvantage when using bind variable in java ? I heard it somecases since before.. Thanks in advance!

    99% of the time, you should be using bind variables. If you have columns which are highly skewed, however, you may want to consider using literals (assuming CURSOR_SHARING=EXACT), since that may allow the CBO to make a better decision.
    If you have an orders table, for example, you may have a status column that specifies whether the order is complete, in transit, or new. If you've been running for a while, 99% of your orders will be complete, so
    SELECT COUNT(*)
      FROM orders
    WHERE status = :1should do a full table scan if you specify 'COMPLETE'. If you passed in 'IN TRANSIT', though, an index scan might be more appropriate. If you want to pass in different values and get different query plans, you need to use literals. 99% of the time, though, you want the same plan, so you want to use bind variables.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Advantages and Disadvantages of using Nintex forms. is this product useful?

    So my company has decided to start developing using Nintex products, we initially had Nintex Workflow and now they are thinking of purchasing Nintex forms. and i was asked to start trying it out.
    I am currently midway through the development of a sharepoint app and i really like the REST APIs available in sharepoint 2013 as they enable me to develop using javascript and HTML5, quite basic stuff but very powerful.
    Now they are asking me to try this black boxed product out, so i have to waste a couple of days on this...
    I watched a couple of youtube videos and all they brag about is how easy it is to drag and drop components on the screen and visually design a form when this is the feature i care about the least. To me what counts most is how easy it would be to customize
    the form to do something that was not foreseen in the black box product.
    What are the advantages/disadvantages of using Nintex forms over using Javascript/HTML 5/Sharepoint REST ?
    many thanks

    With a developer hat on, I can appreciate that custom solutions can potentially be easier to build and manipulate, as you are not adopting anyone's framework and may have less constraints building with a blank canvas each time.
    With a business owner or business analyst hat on, there are many advantages for using a product or application to build repeatable solutions such as forms.
    SharePoint can quickly fall into demise if users (end user or super user) have free reign to build and deploy custom solutions, as they may or may not follow a consistent build pattern, and even other super users or developers can have difficulties interpreting
    and adopting solutions, should someone (such as yourself) leave an organisation.
    This is where products can provide significant return on investment. Products such as Nintex are built by experts in more than HTML, REST and JavaScript, but SharePoint as well. They provide a framework which ensures Form and Workflow designers follow a consistent
    approach, and each solution can quickly be viewed and interpreted by other users.
    Data gathering (forms) and workflow are also usually repeatable and work. I.e. in most organisation you need more than one of each. Products targeted to repeatable tasks are more efficient and accurate than custom code solutions and follow a more consistent
    and defined approach in building t
    Product solutions are continually developed and enhanced - which can be applied to existing creations. E.g. if Nintex Forms deploy an upgrade, all existing forms now have this functionality. There is no manual code updates required. That, and they are also
    supported.
    There is definitely a place for custom development in SharePoint, but for the purposes of quickly repeatable solutions such as forms & workflow, there should be a decent amount of analysis into requirements before taking the custom route.
    Cheers

  • What are disadvantages by using field catalogmerge in ALV

    can any body tell the disadvantages by using field catalogmegre and  maximun how many fields build the filed catalog.

    Hi Diva,
    I have gone thru the advantages... and don't see and disadvantage in building it thru functions....
    The only advantage, that you can maintain dynamically during runtime, the structure of your ALV grid.
    Mostly you are using static structures for ALV, so it is easier to create a static structure in SE11 and give this structure to your ALV_GRID_DISPLAY as a parameter.
    Regards,
    Jayant

  • What are the advantages/disadvantages of using PS/CS5 in 64bit over 32bit please?

    What are the advantages/disadvantages of using PS/CS5 in 64bit over 32bit please?

    From a practical perspective, besides the 64 bit version being a bit faster at just about everything, limitations on document size are lifted in the 64 bit version.  Essentially, how much can do is limited only by how much RAM you have installed in your system.  You can do things like have larger documents, deeper history, etc. and have it all work quickly.
    On the other hand, many 3rd party plug-ins, especially older ones, only provide 32 bit versions, which will only run in 32 bit Photoshop.
    Both 32 and 64 bit versions are installed by default.  It's important to note that most of the preferences are separate between the two, so you can have two slightly different setups that might help with specialty operations you might need.  This gets pretty subtle, but for example I keep the 32 bit version configured with only 1 cache level, so all previews of high bit depth images are always composited in high bit depth.  This aids me with some aspects of astroimage processing.  It's slower, but more accurate.  By contrast I have more cache levels configured for my 64 bit version, so that's faster for general photography work.
    -Noel

  • Disadvantages of using BPM

    can you explain disadvantages of using BPM?????

    Hi Gabriel,
    using BPm is always advantageous  only thing is that complex scenarios are named as BPM.So it is complex
    once you get the idea of BPM then no disadvanges.
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm - Walk through BPM
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm - Schedule BPM
    /people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - Use of Synch - Asynch bridge in ccBPM
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken] - Use of Synch - Asynch bridge in ccBPM
    **PS:Reward points if useful**
    Regards,
    Sumit Gupta

  • Advantages and disadvantages of using views ???

    Hi
    What are the advantages and disadvantages of using views in ABAP porgramming ? 
    Thank You

    hi,
    Data about an application object is often distributed on several tables. By defining a view, you can define an application-dependent view that combines this data. The structure of such a view is defined by specifying the tables and fields used in the view. Fields that are not required can be hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data selection.
    More complicated views can comprise several base tables, the individual tables being linked with a relational join operation. If we dont specify the key fields, it takes time to fetch teh results.
    Regards,
    Sailaja.

  • Writing Objects to file using Externalizable

    Hi,
    I'm trying to write an object to file. My sample code is:
    public class Junk implements Externalizable{
    private static java.util.Random generator = new java.util.Random();
    private int answer;
    private double[] numbers;
    private String thought;
    public Junk(String thought) {
    this.thought = thought;
    answer = 42;
    numbers = new double[3+ generator.nextInt(4)];
    for (int i=0; i<numbers.length; i++) {
    numbers[i] = generator.nextDouble();
    public void writeExternal(ObjectOutput stream) throws java.io.IOException {
    stream.writeInt(answer);
    stream.writeBytes(thought);
    for(int i=0; i< numbers.length; i++) {
    stream.writeDouble(numbers);
    public void readExternal(ObjectInput stream) throws java.io.IOException {
    answer = stream.readInt();
    String thought = stream.readUTF();
    and the class with main() is:
    package MyTest;
    import java.io.*;
    public class SerializeObjects {
    public SerializeObjects() {
    public static void main(String args[]) {
    Junk obj1 = new Junk("A green twig is easily bent.");
    Junk obj2 = new Junk("A little knowledge is a dangerous thing.");
    Junk obj3 = new Junk("Flies light on lean horses.");
    ObjectOutputStream oOut = null;
    FileOutputStream fOut = null;
    try {
    fOut = new FileOutputStream("E:\\FileTest\\test.bin");
    oOut = new ObjectOutputStream(fOut);
    obj1.writeExternal(oOut);
    //obj2.writeExternal(oOut);
    } catch (IOException e) {
    e.printStackTrace(System.err);
    System.exit(1);
    try {
    oOut.flush();
    oOut.close();
    fOut.close();
    } catch(IOException e) {
    e.printStackTrace(System.err);
    System.exit(1);
    The output I get in test.bin contains some junk ascii codes. The only item that is written correctly in the file is the string.
    Is there anyway I can write correct data into a file?
    My output needs to be a readable text format file.
    Can anyone help please?

    obj1.writeExternal(oOut);This should be
    oOut.writeObject(obj1);However,
    The output I get in test.bin contains some junk ascii
    codes. The only item that is written correctly in the
    file is the string.If you don't want 'junk' don't use Externalizable and ObjectOutputStream at all, just use PrintStream/PrintWriter.println().

  • Disadvantages of using REFCURSORs from JDBC

    Hi,
    Normally I write my SQL statements from inside Java (eg PreparedStatements).
    I am investigating on creating PL/SQL Packages, supplying procedures and methods, which I can call from Java using CallableStatements. I understand the advantages of having a layer/API on the database side.
    For example: retrieve some records from a table. (the PL/SQL function getCustomers returns a REFCURSOR)
    - PreparedStatement (select ... from ... where ...) -> executeQuery -> loop ResultSet
    - CallableStatement ("begin ? := getCustomers(); end;") -> cast getObject() to ResultSet -> loop ResultSet
    What are the disadvantages of using the CallableStatement (REFCURSOR)?
    Thanks, regards, Stephan

    While that article may be a good intro for someone not familiar with JDBC it has some misinformation in it that can be misleading at best and cause performance and memory issues at worst.
    Row-prefetching - there is little benefit to using a large value for this setting. As with most things extremes are to be avoided.
    It is important to know how the data is going to be used. What is the point of bringing ALL the data from the DB in one call if you are going to write it to the file system. File I/O is generally the slowest part of an application.
    It is also important that the code be scaleable. Apps should be written so that future modifications will impact existing functionality as little as possible. If you eat up the memory for one table or statement that limits the memory available for other uses. Worse, when things go wrong and you need to reduce the fetch setting you may now have problems everywhere because the testing you originally performed may have relied on that larger fetch setting.
    If the data fetching is not done in its own thread then using a very large value can actually make an application appear to 'freeze' while it waits for the data fetch to complete.
    A large fetch size can also waste significant amounts of memory; essentially allocating it but never using it and never allowing any other process to use it. This is because for a fetch size of 'n' Oracle has to allocate space for 'n' rows that are each of maximum size.
    This wasted is most often due to the common VARCHAR2 datatype. Consider a single column defined as VARCHAR2(100). In the DB this column is stored as variable length. But Oracle will allocate 100 characters (could be multi-byte characters) in order to be able to hold a maximum length value.
    If the actual data values never exceed 30 bytes then 70 bytes in each row are totally wasted. The more rows that are prefetched the more memory that is wasted simply in anticipation of a maximum length value that never occurs or only occurs rarely.
    I've never used a prefetch/fetch size greater than one thousand and that was for tables with small records (no more than 10 or 20 columns).
    And the Oracle docs don't even recommend a setting that high. See the JDBC Dev Guide
    http://docs.oracle.com/cd/B19306_01/java.102/b14355/oraperf.htm#i1043756
    >
    Oracle Row-Prefetching Limitations
    There is no maximum prefetch setting, but empirical evidence suggests that 10 is effective. Oracle has never observed a performance benefit to setting prefetch higher than 50. If you do not set the default row-prefetch value for a connection, then 10 is the default.

  • Advantages and disadvantages of using Caringorm Framework.

    Hi,
    I am new to Caringorm framework.. In our project we need to make discussion whether to use Caringorm framework or a simpler architecture(flex à servicesàServer side) to use
    Please let me know the advantages and disadvantages of using Caringorm framework from your experiences.
    Thanks in advance.

    hi,
    Data about an application object is often distributed on several tables. By defining a view, you can define an application-dependent view that combines this data. The structure of such a view is defined by specifying the tables and fields used in the view. Fields that are not required can be hidden, thereby minimizing interfaces. A view can be used in ABAP programs for data selection.
    More complicated views can comprise several base tables, the individual tables being linked with a relational join operation. If we dont specify the key fields, it takes time to fetch teh results.
    Regards,
    Sailaja.

Maybe you are looking for

  • One apple id for two iPhone

    Is it possible tou use just one aple id for two iPhones?

  • How to set number of rows in filters?

    Hi, we need to set another number of rows which is displayed in filters on bex or web template? Thanks for advice

  • What are the best setting to export video from after effects to get the best video quality ?

    Hi I am editing a raw time lapse in after effects and also some short video clips I would like to export them from after effects and upload them online afterwards but i get a bit lost in exporting settings and formats and mbps.. What are the best set

  • Need join from OM to SR on item or so#

    In the SR, there's a Product Coverage tab with an item and a sales order number. I've looked in quite a few of the cs schema tables but can't find where these are stored. Closest I've come is original_order_number in cs_sr_incidents_v but it's not po

  • ORA-1654 を防ぐには?

    Windows Server 2003 R2 で Oracle9i R2を運用している時にORA-1654が発生しました. 発生時のDBの使用状況 表領域情報: 使用している領域 サイズ:32,768M 増分:1,000M 最大:Unlimited 使用済:32,767M 状態:ONLINE TEMP:8,388M UNDO:5,114M サーバーHDD:空き容量300G以上 で発生しました. その後.再度同じ処理を実行したところORA-1654は発生せずに終了しました. こちらの 他の質問で