Trouble reading object

I am currently running a client/server, server takes commands from client and reads information from database and returns that information to the client. The server is getting the right information and sending the right infromation in the object but my client is only reading the first name and then duplicating it over and over again each time it accepts a new object. Here is the code

publicclass notesAppextends javax.swing.JFrameimplements Runnable{

Socket socket =null;

ObjectInputStream objIn;// = null;

ObjectOutputStream objOut;// = null;

PrintWriter pwOut =null;

BufferedReader brIn =null;

patientObject patient =new patientObject();

RTFEditorKit rtf =new RTFEditorKit();

Thread runner =null;

JFrame frame =new JFrame();

InetAddress inet;

/** Creates new form notesApp */

public notesApp(){

initComponents();

this.setState(this.MAXIMIZED_BOTH);

try{

inet = InetAddress.getLocalHost();

socket =new Socket(inet, 5555);

}catch (UnknownHostException e){

System.out.println("Unknown Host Exception " + uhe.getMessage());

}catch(IOException e){

System.out.println("I/O exception creating stream " + ioe.getMessage());

}catch(NullPointerException e){

System.out.println("Socket not Connected " + npe.getMessage());

}

startNotes();

getLists();

}

/**

* @param args the command line arguments

*/

publicstaticvoid main(String args[]){

java.awt.EventQueue.invokeLater(new Runnable(){

publicvoid run(){

new notesApp().setVisible(true);

}

});

}

publicvoid startNotes(){// creates object streams

try{

objOut =new ObjectOutputStream(socket.getOutputStream());

objIn =new ObjectInputStream(socket.getInputStream());

}catch (StreamCorruptedException e){

System.out.println("Stream Corrupted Exception " + sce.getMessage());

}catch (OptionalDataException e){

System.out.println("Optiona Data Exception" + ode.getMessage());

}catch (IOException e){

System.out.println("IO Exception creating stream" + e.getMessage());

}catch (NullPointerException e){

System.out.println("Socket not connected" + npe.getMessage());

}

if(runner ==null){

runner =new Thread(this);

runner.start();

// System.out.println("got to runner.start");

}

}//end start Notes

// reads contact info and displays results if successful or Failed

publicvoid run(){

System.out.println("got to acceptObject");

while(true){

try{

patient = (patientObject)objIn.readObject();

System.out.println("at try fname = " + patient.getFname());

}catch(EOFException e){

System.out.println("EOF " + eof.getMessage());

break;

}catch(OptionalDataException e){

System.out.println("ODE " + ode.getMessage());

}catch (IOException e){

System.out.println("IOE on read object");

System.out.println(e.getMessage());

System.out.println(e.toString());

}catch(ClassNotFoundException cnf){

System.out.println(cnf);

}

/* PATIENT GETACTION = GETLIST */

if (patient.getAction().equals("getList")){

if (patient.getSuccess()){

JOptionPane.showMessageDialog(frame,"Success - List Received","Success", JOptionPane.DEFAULT_OPTION);

System.out.println("fname = " + patient.getFname() +" lname = " + patient.getLname());

fillPatientCbo();

}else{

JOptionPane.showMessageDialog(frame,"Failure - List Not Received","Warning", JOptionPane.DEFAULT_OPTION);

}

Any help would be appreciated. I thought possibly garbage collection wasn't being done to clear the patientObject when a new one is being read. If any more information is needed please let me know.

[7633 byte] By [developprogramsa] at [2007-11-26 13:01:42]
# 1
I would gues that you are sending the same object each time but with a different content so the ObjectOutputStream is caching the object. Do a reset() on the ObjectOutputStream before you send the object.
sabre150a at 2007-7-7 17:03:39 > top of Java-index,Java Essentials,Java Programming...
# 2
I did a .reset() on my server side and it works. I originally did a flush and thought that would be enough, but the reset got it to work. Thanks for your help.
developprogramsa at 2007-7-7 17:03:39 > top of Java-index,Java Essentials,Java Programming...
# 3
> Thanks for> your help.:-) It is rare to get thanked so thanks for the thanks. Come back again soon.
sabre150a at 2007-7-7 17:03:39 > top of Java-index,Java Essentials,Java Programming...