Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8673769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:32:38+00:00 2026-06-12T19:32:38+00:00

I use a Socket-based connection between Client and server with ObjectOutputStream. The objects serialized

  • 0

I use a Socket-based connection between Client and server with ObjectOutputStream.

The objects serialized and exchanged have this structure:

public class RichiestaSalvataggioArticolo implements Serializable {

        private ArticoloDati articolo;

        public RichiestaSalvataggioArticolo(ArticoloDati articolo) {
                this.articolo = articolo;

        }

        @Override
        public void ricevi(GestoreRichieste gestore) throws Exception {
                gestore.interpreta(this);                    
        }


        public ArticoloDati getArticolo() {
                return articolo;
        }

}

the issue is that when I try to exchange messages between C/S with incapsulated content very similar (ArticoloDati whom differ only in 2 fields out of 10), the Client sends an ArticoloDati, but the Server receives the previous one.

Does the ObjectOutputStream implement some kind of cache or memory between the calls, that fails to recognize that my 2 objects are different because they are very similar?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:32:39+00:00Added an answer on June 12, 2026 at 7:32 pm

    You need to disable “back-references” in serialization, so use ObjectOutputStream.writeUnshared.

    Writes an “unshared” object to the ObjectOutputStream. This method is identical to writeObject, except that it always writes the given object as a new, unique object in the stream (as opposed to a back-reference pointing to a previously serialized instance).

    It’s good practice to couple this with ObjectInputStream.readUnshared in some cases — this one included.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client-server application which communicates over TCP/IP. I use System.Net.Sockets.Socket type object
I have a c# socket based server which serves TCP clients. I use telnet
in server -(multi)client application [TCP]. I use Socket, NetworkStream, StreamReader and StreamWriter for each
I become use raw socket and i have this problem: bad file descriptor the
I use node.js and socket.io. I have an application that runs on the IP
I am learning socket programming for use in an upcoming project, and I have
I am trying to use the code from Microsoft for an Async Socket connection.
I have a simple python telnet based chat server that lacks the functionality for
I have a class that Handles send & receive over a socket between my
I have a client-server program that uses sockets to transfer information in a stateful

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.