View Single Post
  #1 (permalink)  
Old 05-21-2008, 05:41 PM
sajdutt sajdutt is offline
Member
 
Join Date: May 2008
Posts: 4
sajdutt is on a distinguished road
Object Comparison!
Ok guys,

I have a problem and I don't know what causes it.

In one of the classes, I used a statement like:

if(a.getClientId() == b.getClientId()){...}

getClientId returns ID object which implements Comparable, Cloneable, Serializable.

This returns true when I run it from my local resin server. Now, if I link my server to another server by means of synchronization, the above statement returns false. Of course, if I used "equals" instead of "==", there would have been no problem. ..and I know the rules of Object comparison. My question is if the above statement works in a standalone server, then why it doesn't when the two servers are synced? Again, using "equals" solves my problem but that's not what I wanna know. Any idea?


How it is synced:

I have two machines (Apple and Orange). Both using resin servers.

I modified a portion of my web.xml:

Apple's web.xml file:

<init-param Apple-peer='Apple Orange'/> <!-- Before it was:<init-param Apple-peer='Apple'/> -->
<init-param Apple-db='Apple/SERVER'/>
<init-param Apple-db-connections='5'/>

Orange's web.xml file:

<init-param Orange-peer='Orange Apple'/> <!-- Before it was:<init-param Orange-peer='Orange'/> -->
<init-param Orange-db='Orange/SERVER'/>
<init-param Orange-db-connections='5'/>

Now, two machines have to be started simultaneously, otherwise, one will wait for the other one to start.

Thank a lot in advance.
Reply With Quote
Sponsored Links